Skip to content

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

Open
dylanahsmith wants to merge 1 commit into
mainfrom
scope-as-array
Open

dylanahsmith wants to merge 1 commit into
mainfrom
scope-as-array

Conversation

@dylanahsmith

Copy link
Copy Markdown
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
Copy Markdown

Awesome! 👍

@EiNSTeiN-

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

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

This branch has not been deployed

No deployments
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.

4 participants