aspnet / AspNetKatana

Microsoft's OWIN implementation, the Katana project
Apache License 2.0
967 stars 334 forks source link

Facebook relogin with more permissions? #64

Closed Andrei- closed 4 years ago

Andrei- commented 7 years ago

This is not a bug, but can't seem to find a nice way to solve the problem, so I'm asking here. I use Facebook login form my users, so, they are asked to authorize basic permissions (email, name) at login. And these permissions are set in app startup with a FacebookAuthenticationOptions object. But for a small group of users I need to request more permissions from Facebook, (facebook page, cover, etc). My plan is to try and relogin to Facebook with more permissions in list, but there is no way of changing permission fields only for some users, as the original FacebookAuthenticationOptions is untouchable once it's defined. Any suggestions?

Tratcher commented 7 years ago

You can do this either with two Facebook middleware that have different auth scheme names and options, or you can override the authorization redirect in https://github.com/aspnet/AspNetKatana/blob/b850cd8b4de61e65bbd7127ce02b5df7c4cb6db5/src/Microsoft.Owin.Security.Facebook/Provider/FacebookAuthenticationProvider.cs#L21