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

荒凉一梦 提交于 2019-12-03 06:31:35

You may have figured out a solution to this problem already but I figured I'd chime in for those still looking to solve this. My solution allows you to request as little Facebook permissions as possible up front, and then dynamically request them as your app needs them.

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

Hope this helps!

It looks like they're adding that to Omniauth, but it's still in beta.

You add a

:setup => true

to your provider and then create a method where you dynamically sets the options (credentials/scope) you need.

https://github.com/intridea/omniauth/wiki/Setup-Phase

https://github.com/intridea/omniauth/wiki/Dynamic-Providers

I think you can't do that properly. Because you can't be sure your user use only the photo feature. You user can access to all part of you application photo feature and other feature. When the user is logged and switch from your photo feature to other feature, you can't ask it to re-logged. to access this other feature.

All user don't really check what kind of access their authorize, so don't worry about a lot of permission asking.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!