question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After logging in with interactive the application does not grab the response.

See original GitHub issue

Which Version of MSAL are you using ? 4.5.1

Platform Xamarin.Forms - testing on android.

What authentication flow has the issue?

  • Desktop / Mobile
    • Interactive
    • Integrated Windows Auth
    • Username Password
    • Device code flow (browserless)
  • Web App
    • Authorization code
    • OBO
  • Web API
    • OBO

Is this a new or existing app? New app.

<activity android:name="microsoft.identity.client.BrowserTabActivity">
      <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="msal[removed]" android:host="auth" />
      </intent-filter>
    </activity>

        protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
        {
            base.OnActivityResult(requestCode, resultCode, data);

            AuthenticationContinuationHelper.SetAuthenticationContinuationEventArgs(requestCode, resultCode, data);
        }

...

IPublicClientApplication client = PublicClientApplicationBuilder.Create(B2CConstants.ClientID)
                .WithB2CAuthority(B2CConstants.AuthoritySignInSignUp)
                .WithIosKeychainSecurityGroup(B2CConstants.IOSKeyChainGroup)
                .WithRedirectUri("https://login.microsoftonline.com/tfp/oauth2/nativeclient")
                .Build();

                AuthenticationResult result =  await client.AcquireTokenInteractive(B2CConstants.Scopes)
                .WithParentActivityOrWindow(App.Activity)
                //.WithUseEmbeddedWebView(true)
                .ExecuteAsync();

I am able to log into the form it brings when this is called, but the application does not grab the response after the log in is successful. If I manually go back it will say it was canceled by the user. The response’s url is something like: “?state = very long token” so I assumed that part is working.

When I set “WithUseEmbeddedWebView” to true the application comes back after I log in but I get this exception which I don’t quite understand:

Microsoft.Identity.Client.MsalServiceException: 'AADB2C90079: Clients must send a client_secret when redeeming a confidential grant.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asusraliscommented, Oct 28, 2019

I think I was just confused about how to use the scopes and needing to declare that my client wanted to access my api, but I don’t think my ignorance came from this repo’s documents. I used the scopes I had from a docs.microsoft.com webpage about azure AD.

My needs from AD are fairly simple but AD - and this repo - seems quite large, so there was just a lot of reading I had to go over. For the time spent on this I ended up needing to write only around 20 lines of code for it to work.

0reactions
jmprieurcommented, Oct 28, 2019

I’m glad you made it work, @asusralis

Can you please help us improving our docs and guidance by answering the following questions? What could we have done better so that you had not been confused in the first place? Where did you get the idea of using the scopes you had used? What was the haha moment where you understood? Ideally what would have helped you getting straight to the solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Web app with Msal Interactive Signing failing with redirect
This works locally as redirect to local host on the app builder works fine but when deployed to azure app service this fails...
Read more >
Using IBKR Mobile Authentication (IB Key)
Log into IBKR Mobile using IB Key · Log into TWS for Desktop using IB Key · Log into Account Management using IB...
Read more >
aws ecr saying "Cannot perform an interactive login from a ...
The problem is not aws but docker. The solution is on docker to use the -p parameter, and wrap the aws login call...
Read more >
Troubleshoot Sign in with Google - Google Account Help
This guide can help you troubleshoot issues you encounter while you use Sign in ... can't use Sign in with Google, you might...
Read more >
Configure Silent Authentication
If the user was already logged in to Auth0 and no other interactive prompts are required, Auth0 will respond exactly as if the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found