AcquireToken should return IAuthenticationResult instead of AuthenticationResult
See original GitHub issueIPublicClientApplication.AcquireTokenAsync
& IPublicClientApplication.AcquireTokenSilentAsync
currently return an AuthenticationResult
which is restrictive with internal ctor’s, and ultimately requires an instance of an internal class to provide a token.
This creates a problem for unit testing other libraries. While IPublicClientApplication can be mocked, there is no easy way to return a result as part of a unit test in external libraries. If AcquireTokenAsync
and AcquireTokenSilentAsync
were to return an IAuthenticationResult instead this would make it easy to create a mock response for unit testing other libraries.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
MSAL is difficult to test because AuthenticationResult is not ...
MSAL is not easily mockable because the AuthenticationResult is an immutable sealed class with no public constructors.
Read more >Desktop app that calls web APIs: Acquire a token interactively
On Windows, you must call AcquireTokenInteractive from the UI thread so that the embedded browser gets the appropriate UI synchronization ...
Read more >Acquire tokens to call a web API (daemon app)
Web, you don't need to acquire a token. You can use higher level APIs, as you see in Calling a web API from...
Read more >AcquireToken(System.String, Microsoft.IdentityModel. ...
I am using the bytearray coming from the HttpRequest to create the x509 object. However I get this error: Message "Method not found:...
Read more >c# - AcquireTokenSilent is Failing to acquire token silently?
AcquireTokenSilentAsync will try all ways it can to get you a valid token without prompting for an interactive auth request.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for your tip, @AmirSasson For info on the migration, in case this helps, you can checkout https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-net-migration
@AmirSasson ADAL is deprecated. We won’t change it.