Sometimes you might need special permissions right from start on your web application. Default MVC 4 OAuth clients only ask basic permissions and you can’t change that behavior unless you create your own OAuth client. I did that for Facebook and later on will continue with other providers when needed
You can find the source code from here
Here’s the guide how to use it:
- Create new MVC 4 web application
- Open package manager console
- Write "Install-Package MVCScopedClient"
- Open authconfig.cs
- Write Using MVCScopedClients;
- Add this line to RegisterAuth() function OAuthWebSecurity.RegisterClient(new FacebookScopedClient("API-key", "API-secret", "PermissionScope"), "Facebook", new Dictionary<string, object>());
- Done