2016-10-03 65 views
0

在C#ASP.NET MVC 4中,我使用OAuthWebSecurity以Facebook身份登录。 我需要Email等等。但Email最重要的部分和没有它应用程序应该继续。如何在用户使用MVC4 OAuthWebSecurity编辑权限时再次请求权限?

如您所知,第一张图片是请求。但是在这一步用户可以编辑的权限。 enter image description here

而之前改变Email继续这样下去,第二图象: enter image description here

这是问题所在;一旦用户已禁用Email选项,我不能重新请求第一张图片在C# MVC4一侧。它总是绕过并返回没有电子邮件。

我怎样才能再次请求显示第一张图片Email被禁用?

另外,如果你必须知道如何我的Facebook登录,我在这里https://github.com/tapanila/MVCScopedClient/blob/master/Source/MVCScopedClients/FacebookScopedClient.cs

回答

0

使用的代码通过添加auth=rerequest解决了这个问题。

public void RequestAuthentication(System.Web.HttpContextBase context, Uri returnUrl) 
     { 
      string url = baseUrl + _appId + "&redirect_uri=" + HttpUtility.UrlEncode(returnUrl.ToString()) + "&scope=" + scope + "&auth_type=rerequest"; 
      context.Response.Redirect(url); 
     } 
相关问题