I cannot seem to figure out how to acquire an access token using MSAL. I’ve spend time reading the source code and Microsoft documentation to no avail. I’d like to use the PublicClientApplication to acquire the token. Even when running proof of concepts with the QuickStarts using ConfidentialClientApplication I seem to only get an ID_Token not an access token.
Ultimately I’m trying to build a desktop/mobile app and want to be able to use MSAL for id token claims and access tokens for access to APIs. Also worth mentioning I want to implement this using AAD B2C Thanks!
2
Answers
To get your access use the
acquire_token_silent
oracquire_token_interactive
methods of thePublicClientApplication
class.Below is an example, replace the needed variables with your own.
I have reproduced in my environment and got expected results as below and followed Microsoft-Document:
Output:
Here
csecret
is client secretcid
is client idtid
is tenant id