相关疑难解决方法(0)

在MVC4中使用DotNetOpenAuth的完整个人资料

我的MVC4应用程序允许使用LinkedIn帐户登录.我想从登录用户的linkedIn中提取所有可用的详细信息.目前我做了以下工作.

在My AuthConfig.cs中,

  Dictionary<string, object> linkedInExtraData = new Dictionary<string, object>();           
        linkedInExtraData.Add("Icon", "../Images/linkedIn.png");          
        OAuthWebSecurity.RegisterClient(
          client: new App_Start.LinkedInCustomClient("xxxxxxxxxxxx", "yyyyyyyyyyyyyyy"),
          displayName: "LinkedIn",
          extraData: linkedInExtraData);
Run Code Online (Sandbox Code Playgroud)

在linkedIncustomClient.cs中,来自LinkedIn Developer Kit

public class LinkedInCustomClient : OAuthClient
{
    private static XDocument LoadXDocumentFromStream(Stream stream)
    {
        var settings = new XmlReaderSettings
        {
            MaxCharactersInDocument = 65536L
        };
        return XDocument.Load(XmlReader.Create(stream, settings));
    }


    /// Describes the OAuth service provider endpoints for LinkedIn.
    private static readonly ServiceProviderDescription LinkedInServiceDescription =
            new ServiceProviderDescription
            {
                AccessTokenEndpoint =
                        new MessageReceivingEndpoint("https://api.linkedin.com/uas/oauth/accessToken",
                        HttpDeliveryMethods.PostRequest),
                RequestTokenEndpoint =
                        new MessageReceivingEndpoint("https://api.linkedin.com/uas/oauth/requestToken?scope=r_fullprofile",
                        HttpDeliveryMethods.PostRequest),
                UserAuthorizationEndpoint = …
Run Code Online (Sandbox Code Playgroud)

oauth linkedin asp.net-mvc-4

7
推荐指数
1
解决办法
5520
查看次数

标签 统计

asp.net-mvc-4 ×1

linkedin ×1

oauth ×1