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.

Question: Is Prompt.ForceLogin Supposed to Show Consent Request UI If Required Also?

See original GitHub issue

I’m running into AADSTS65001 error for a new user account. Previous behavior from ADAL, I believe, was if UI was presented, consent request was displayed right after.

Is Prompt.ForceLogin also supposed to show consent request IF not previously granted? I understand Prompt.Consent exists, but don’t want to request it if already granted.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jmprieurcommented, Apr 9, 2019

@myokeeh We don’t recommend you to use neither Prompt.ForceLogin, nor Prompt.Consent. Using the default prompt does the best possible.

However to pre-prompt the user upfront, you can use the .WithExtraScopesToConsent method

string[] scopes = { resourceId + "/user_impersonation" };
var users = await pca.GetAccountsAsync();
var user = users.FirstOrDefault();
 try
                {
                    msalar = await pca.AcquireTokenSilent(scopes, user)
                                      .ExecuteAsync();
                }
                catch (MsalUiRequiredException ee)
                {
                        //present UI to have user consent
                        msalar = await pca.AcquireTokenInteractive(scopes, user)
                                          .WithExtraScopesToConsent(new [] {"user.read"})
                                          .WithClaims(ee.Claims)
                                          .ExecuteAsync();
                }
0reactions
jmprieurcommented, Apr 10, 2019

Thanks for the update @myokeeh !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected consent prompt when signing in to an ...
In this article​​ These requests result in a consent prompt being shown the first time an application is used, which is often a...
Read more >
Prompt behavior with MSAL.js - Microsoft Entra
Ensures that the user isn't presented with any interactive prompt. If the request can't be completed silently by using single-sign on, the ...
Read more >
Force Reauthentication in OIDC
Describes how to use the max_age authentication request parameter as a mechanism whereby relying parties can positively confirm that re-authentication has ...
Read more >
Using OAuth authentication with your application
OAuth provides a secure way for your application to access Zendesk data without having to store and use the passwords of Zendesk users,...
Read more >
Understanding the Certification Questions - EDD - CA.gov
Understanding the Certification Questions. By certifying, you are declaring by law that you meet the eligibility requirements to be paid unemployment benefits.
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