maxmantz / redux-oidc-example

Small ReactJS application to demonstrate the usage of redux-oidc
MIT License
108 stars 68 forks source link

Getting the id_token instead of the access_token #13

Closed Hyjaz closed 6 years ago

Hyjaz commented 6 years ago

I have the following settings:

    client_id: '{client_id}',
    response_type: 'token id_token',
    scope: 'openid profile',
    authority: 'https://login.microsoftonline.com/{tenant_id}',
    redirect_uri: 'http://localhost:5000/oidc-client-sample.html',
    post_logout_redirect_uri: 'http://localhost:5000/oidc-client-sample.html',
    resource: 'https://domain/WebApplication17',
    automaticSilentRenew: true,
    filterProtocolClaims: true,
    loadUserInfo: true,
    metadata: {
      issuer: 'https://sts.windows.net/{tenant_id}/',
      jwks_uri: 'https://login.microsoftonline.com/{tenant_id}/discovery/keys',
      end_session_endpoint: 'https://login.microsoftonline.com/{tenant_id}/oauth2/logout',
      authorization_endpoint: 'https://login.microsoftonline.com/{tenant_id}/oauth2/authorize',
      token_endpoint: "https://login.microsoftonline.com/{tenant_id}/oauth2/token",
    },
    signingKeys: [{}]
  };

When I create my request with the sample server with these settings, the access_token that I receive is incorrect, basically the access_token is my id_token.

I am receiving back a token starting with ey where as the access token usually start of with AQA.... Also when I call the endpoint openid/userinfo I get a bad request response because the bearer token is invalid. The reason why it's invalid is because the token that I get back is the id_token and not the access_token. Any idea why that is the case?

maxmantz commented 6 years ago

No - from the config side it looks ok. Maybe your question is better directed at the oidc-client-js page.