Twilio conversation js sdk Conversation.create() is depreceated - react-hooks

Working with Twilio conversation-demo app, but
ConversationsClient.create(this.state.token);
.create method is depreceated, so how can we initConversations.
And anyone can please help me how to do the sdk in react hooks.

with "#twilio/conversations": "^2.1.0", creating chat token from the ConversationsClient.create is deprecated. you should be creating a token from a server before you can use client instance as follows:
import {Client} from '#twilio/conversations'
const client = new Client(token)

Related

how to implement certificate based authentication for Microsoft Bot Framework v4 bot in the code using .netcore?

I'm looking for certificate-based bot authentication. I found some approach in node js as below
const adapter = new BotFrameworkAdapter({ appId: process.env.MicrosoftAppId, useCertificateAuthentication: true, certificateThumbprint: '33***608A6******19***325D*****8****', certificatePrivateKey: certKey }); const fs = require('fs'); var certKey = fs.readFileSync('./DEV-private.key').toString() .
If you see the above piece of code there instead of app password we are using a certificate for app id authentication of the bot.
But I just want to implement the same in .netcore 3.1. I'm not able to find any reference on how to do this.
The BotFramework Adapter incorporates the Authentication library for setting up authentication via a certificate. You can see which classes and properties are used and/or available by referencing Microsoft.Bot.Connector.Authentication in the botframework-dotnet repo, in particular the AdalAuthenticator class. You can see how it is used and what properties are passed in the BotFramework Adapter.

Integrate Laravel Socialite with React Native Frontend using Passport

I have a Laravel server with socialite and passport. I installed the coderello plugin to have the grant_social type. When I authorize the social, I reply from laravel to the client with a JSON with the social auth token. How can I capture it from my react app so I can use to make API calls? And how should I login with social? Should I use manual redirect with a WebView or should I use the official social's SDKs?
I solved using a view as response that contains a script that calls window.ReactNativeWebView.postMessage and in my React app I use onMessage callback inside the WebView.

Lamba calls always triggering fallback intent ? How to authorize botium with amzon lex IdentifypoolID?

I am using botium for my chatbot which is built on top of Amazon lex.
For normal intents, it is recognized properly from the botium emulator
For the intents which invoke lambda calls triggers default fallback intent always.
I am suspecting it is because of aws config credentials which I am using to authenticate the client side(CognitoIdentifyPoolId)
AWS.config.region = 'us-east-1'; // Region
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: 'us-east-1:xxxxxxxxxxxxxxxxx',
});
I don't know how to pass it from botium json. Please help me to solve this ?
Identity Pools are not supported yet.
Best you can now, to add access to Lambda for Botium user. Is it acceptable for you?

OAuth2.0 integration with Xamarin

We build our own "OWIN OAuth 2.0 Authorization Server" using "Microsoft.AspNet.Identity.Owin" and "Microsoft.Owin" framework. Ref: https://learn.microsoft.com/en-us/aspnet/aspnet/overview/owin-and-katana/owin-oauth-20-authorization-server
We can be able to send a request to our custom OAuth2.0 server and get OAuth2.0 access token from web applications by using "DotNetOpenAuth.OAuth2.Client".
Also, we can be able to successfully integrate our custom OAuth2.0 server with Cortana bot channel and its working fine.
But while integrating our custom OAuth2.0 server with Xamarin mobile application we are facing issues related to redirect_uri. We get a response like invalid_grant.
We are using "Xamarin.Auth" framework in Xamarin to send the OAuth request.
Here is the redirect_uri, we used in Web and Mobile
a. Xamarin app redirect_uri: com.Demo.Mobile:/oauth2redirect
b. Web site redirect_uri: https://demowebsite.azurewebsites.net/
https://user-images.githubusercontent.com/5037741/54964768-10d0ca80-4f44-11e9-9fd9-92673f07f919.png
Thanks in advance for help on this :)
We resolved the issue by using this redirect_uri pattern oauth2redirect:/com.company.package/

How to use context.GetUserTokenAsync in Bot Framework 4.0? (or some Middleware Authentication)

We are in the process of converting our Bot over to Bot Framework 4.0 but have found an issue...
To get the current user of the Bot we're calling context.GetUserTokenAsyn to get the token from the login, which is done through Azure AD. The token contains data we need to retrieve data from external systems.
Now... Bot Framework 4.0 has a ITurnContext which has a Activity.Context but unfortunately it is of type DialogContext, not the IDialogContext which have the GetUserTokenAsync.
Does anyone know how to utilize the GetUserTokenAsync in 4.0 or is there some Middleware I can use for authentication (to retrieve the auth token)?
// Tommy
This function exists in v4 and functions in a similar fashion, but requires one extra step. Calling GetUserTokenAsync will look something like as follows:
var client = CreateOAuthApiClient(context);
var token = client.GetUserTokenAsync("<userid>", "<connectionname>", "<magicCode>");
After this the token will function as normal.
Here is an example of this in code, although it is within the v4 SDK itself.
You can try this also if you want to get the token with the magic number:
var tokenResponse = await (turnContext.Adapter as IUserTokenProvider).GetUserTokenAsync(turnContext, _connectionName, magicCode, cancellationToken: cancellationToken);
You can find the sample here.

Resources