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

OAuthService.storeAccessTokenResponse(): ERROR TypeError: grantedScopes.split is not a function #687

Closed
bspire opened this issue Dec 17, 2019 · 2 comments
Labels
more-info-needed Please provide a minimal example (e.g. at stackblitz.com) which demonstrates the issue question For tagging support requests and general questions.

Comments

@bspire
Copy link

bspire commented Dec 17, 2019

I am getting the following error when the access token is stored:

OAuthService.storeAccessTokenResponse(): ERROR TypeError: grantedScopes.split is not a function

This happens because at this line grantedScopes is assumed to be a string which is in fact an array in my case:

granted_scopes

Here is my configuration:

export const authConfig: AuthConfig = {
    clientId: 'xxx',
    dummyClientSecret: 'xxx',
    loginUrl: 'https://api.netatmo.com/oauth2/authorize',
    scope: 'read_station',
    requireHttps: true,
    oidc: false,
    redirectUri: 'http://localhost:4200',
    tokenEndpoint: 'https://api.netatmo.com/oauth2/token',
    showDebugInformation: true,
    requestAccessToken: true,
    responseType: 'code'
}

I use angular-oauth2-oidc version 8.0.4.

Best regards,
Stefan

@jeroenheijmans
Copy link
Collaborator

As far as I've seen, the scope should always be a space-delimited string, not an array. If I read it right RFC 6749 says the same. So I'd hazard a guess that your Identity Server is not complying?

@jeroenheijmans jeroenheijmans added more-info-needed Please provide a minimal example (e.g. at stackblitz.com) which demonstrates the issue question For tagging support requests and general questions. labels Mar 8, 2020
@manfredsteyer
Copy link
Owner

To prevent this issue, beginning with v 9.1, the lib checks now if it is a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed Please provide a minimal example (e.g. at stackblitz.com) which demonstrates the issue question For tagging support requests and general questions.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants