Forum Discussion
How to use SendOAuthCardAsync to send oauth prompt and wait for the token response
We are using OAuthPrompt " SendOAuthCardAsync " method to send oauth prompt to enable local language translation await
OAuthPrompt.SendOAuthCardAsync(new OAuthPromptSettings
{
ConnectionName = ConnectionName,
Text = "Please login",
Title = "Login",
Timeout = 300000,
}, stepContext.Context, null, cancellationToken);
But its not returning any dialog details. Is there any alternative solution to send the dialog result so that we can send the dialog details in dialog stack before redirecting to the token validating dialog step
- Sayali-MSFTMicrosoft
Lakshmi_145- Thanks for reporting your issue.
We will investigate this issue and get back to you. - Sayali-MSFTMicrosoft
Lakshmi_145 -An Invoke Activity is sent to the bot rather than the Event Activity used by other channels. This Invoke Activity must be forwarded to the dialog if the OAuthPrompt is being used.
You can try with the below sample-AddDialog(new TokenExchangeOAuthPrompt( nameof(TokenExchangeOAuthPrompt), new OAuthPromptSettings { ConnectionName = ConnectionName, Text = "Please Sign In", Title = "Sign In", Timeout = 1000 * 60 * 1, // User has 5 minutes to login (1000 * 60 * 5) //EndOnInvalidMessage = true })); AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
- Lakshmi_145Brass Contributor
Is TokenExchangeOAuthPrompt is same as like OauthPrompt. When i added TokenExchangeOAuthPrompt i was getting error.
Reason why i used SendOAuthCardAsync is to get the Signin card in the application local language.
If add as dialog , it will take the local system language.
While using SendOAuthCardAsync , i am getting the sign in card in local language and once after logging successfully , its coming to token response event , but we are not able to come back to the dialog from where this oauth card is sent. It is able to find the particular dialog from dialog stack, but while calling RunAsync on the dialog its not going to the respective dialog step
- ChetanSharma-msftMicrosoftHello Lakshmi_145 - Could you please share a short video and share your code snippets, so that we can try to repro it from our end?