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

Problem when using multiple scopes #258

Open
eduardoboucas opened this issue Jul 24, 2015 · 2 comments
Open

Problem when using multiple scopes #258

eduardoboucas opened this issue Jul 24, 2015 · 2 comments

Comments

@eduardoboucas
Copy link

There's a problem with the GitHub example. When selecting multiple scopes, which happens by default in that example, only the last scope is actually requested to the API. This happens because of the way the auth URL is generated.

The URL generated is:

https://github.com/login/oauth/authorize?redirect_uri={uri}&scope=repo&scope=user&state={state}

But it should be:

https://github.com/login/oauth/authorize?redirect_uri={uri}&scope[]=repo&scope[]=user&state={state} (using the array notation for keys with multiple values).

I've created a pull request on the package that is being used to generate the query strings, so I guess the next step is to see if that is merged in.

@mansilladev
Copy link
Contributor

According to the GitHub v3 docs isn't scope supposed to be in one query param comma separated? I typically see this pattern of a single scope param, but with different delimiters (i.e. Runscope's API uses spaces between scopes)

@Starefossen
Copy link

The example code should read:

    var authURL = oauth2.getAuthorizeUrl({
        ...,
        scope: 'repo,user',
        ...,
    });

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