deyan
deyan

Reputation: 112

How to use omniauth-google-oauth2 gem with incremental authorization in Rails?

I'm using the omniauth-google-oauth2 gem. My oauth2 setup is really similar to the one here: https://gist.github.com/sevos/821291 , meaning that I keep my scopes in a config/authentication_services.yml file.

I would like to exclude a scope from the initial request, and ask for that scope only at the point when I need it?

Upvotes: 1

Views: 612

Answers (1)

madsheep
madsheep

Reputation: 416

What you need is probably connected to dynamic scope setting with omniuath. Few reads that might get you closer, they are about facebook oauth, but the general notion is very similar - you need to use omniauths setup hook.

http://www.mikepackdev.com/blog_posts/2-Dynamically-Requesting-Facebook-Permissions-with-OmniAuth

How can I specify the Facebook permissions (aka scope) OmniAuth asks for DYNAMICALLY?

http://www.mikepackdev.com/blog_posts/2-Dynamically-Requesting-Facebook-Permissions-with-OmniAuth\

Upvotes: 0

Related Questions