Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot fetch ID token in the response #15

Open
savaliyap opened this issue Feb 21, 2023 · 8 comments
Open

Cannot fetch ID token in the response #15

savaliyap opened this issue Feb 21, 2023 · 8 comments

Comments

@savaliyap
Copy link

savaliyap commented Feb 21, 2023

my config is like this


let options: LoginOptions = {
  clientId: '<>',
  tenant: '<>',
  authorityUrl: 'https://login.microsoftonline.com/<tenant>',
  scopes: ['User.Read', 'openid', 'profile'],
  authorityType: "AAD",
  keyHash: '<keyHash>',
}


and I use it like this

const result = await MsAuthPlugin.login(environment.authenticationOptions);

and in response I only get accessToken and scopes (idToken is not present at all)
image

@bartwesselink
Copy link
Member

Hi @savaliyap! Could you please give some more context? Like, are you getting an error message, if so: what message do you get? What are you trying to achieve, and how are you invoking the plugin?

@savaliyap
Copy link
Author

savaliyap commented Feb 21, 2023

Hello @bartwesselink , yeah so

my config is like this


let options: LoginOptions = {
  clientId: '<>',
  tenant: '<>',
  authorityUrl: 'https://login.microsoftonline.com/<tenant>',
  scopes: ['User.Read', 'openid', 'profile'],
  authorityType: "AAD",
  keyHash: '<keyHash>',
}


and I use it like this

const result = await MsAuthPlugin.login(environment.authenticationOptions);

and in response I only get accessToken and scopes (idToken is not present at all)
image

@bartwesselink
Copy link
Member

Mm, that is strange. What platform are you using?

@savaliyap
Copy link
Author

Mm, that is strange. What platform are you using?

I am using ionic 6 and the emulator I am testing on have Android 11 as OS

@bartwesselink
Copy link
Member

Are you using an older version of the plugin? The ID token is available from version 3.0 onwards.

@savaliyap
Copy link
Author

Are you using an older version of the plugin? The ID token is available from version 3.0 onwards.

Yes, I am using v3.1.2

image

@bartwesselink
Copy link
Member

@savaliyap so I dove into this, and there is one possible reason that could cause this. In the tenant that you are logging into, are you a guest there? Because in the current implementation, the plugin does not support retrieving an ID-token in that case.

@jensuenk
Copy link
Contributor

jensuenk commented May 10, 2024

Having the same issue. I get null for the idToken response while debugging with Android. iOS works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants