azure-activedirectory-library-for-cordova icon indicating copy to clipboard operation
azure-activedirectory-library-for-cordova copied to clipboard

(ADAL) integration with ionic getting “We are unable to issue tokens” , need to use v 2.0

Open akshgods opened this issue 5 years ago • 1 comments

I’m using MS ADAL for login authentication in ionic 3. Login screen appearing , when i'm login, its sending issue, getting error : We are unable to issue tokens from this API version for microsoft account… use version 2.0 of the protocol to support this.

my code:

let authContext: AuthenticationContext = this.msAdal.createAuthenticationContext(‘https://login.windows.net/common’);
authContext.acquireTokenAsync(‘https://graph.windows.net’, ‘4324dsad-b5c3’, ‘http://localhost:8000’,"","")
.then((authResponse: AuthenticationResult) => {
console.log(‘Token is’ , authResponse.accessToken);
console.log(‘Token will expire on’, authResponse.expiresOn);
})
.catch((e: any) => console.log(‘Authentication failed’, e));

akshgods avatar May 27 '19 06:05 akshgods

Are you perhaps using a personal account to sign in? If so: that will not work. ADAL does not support b2c. You would need MSAL (which is sort of v2 of ADAL)

martinlingstuyl avatar May 27 '19 08:05 martinlingstuyl