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

feature: Allow the scope to be passed in as an array. #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dylanahsmith
Copy link
Contributor

@EiNSTeiN- for review
cc @minasmart

Based on recommendation in issue #41

This allows the scope to be passed in as an array of strings, which is more natural for a ruby API

provider :shopify, ENV['SHOPIFY_API_KEY'], ENV['SHOPIFY_SHARED_SECRET'], scope: ['read_products', 'read_orders', 'write_content']

@minasmart
Copy link

Awesome! 👍

@EiNSTeiN-
Copy link
Contributor

I'm not sure this is a good idea because no omniauth provider work this way, this is completely custom and likely won't be expected by people who have dealt with other omniauth strategy providers in the past.

@dylanahsmith
Copy link
Contributor Author

Well, it doesn't look like we can propose doing this upstream, since I just looked at what the Oauth2 spec says about the scope parameter, and it says:

The value of the scope parameter is expressed as a list of space-delimited, case-sensitive strings.

which would suggest that .join(' ') would be more appropriate upstream.

@EiNSTeiN-
Copy link
Contributor

which would suggest that .join(' ') would be more appropriate upstream.

That's strange. Omniauth strategies I've seen all seem to use commas.

https://github.com/intridea/omniauth-github#scopes
https://github.com/zquestz/omniauth-google-oauth2#configuration
Just to name a few

@dylanahsmith
Copy link
Contributor Author

Oh, well I just went by what I read on https://tools.ietf.org/html/rfc6749#section-3.3

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

Successfully merging this pull request may close these issues.

None yet

4 participants