示例#1
0
        public override ProviderCredentials CreateCredentials(
            ClaimsIdentity claimsIdentity)
        {
            Claim name = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);
            Claim providerAccessToken = claimsIdentity
                .FindFirst(ServiceClaimTypes.ProviderAccessToken);

            LinkedInCredentials credentials = new LinkedInCredentials
            {
                UserId = this.TokenHandler.CreateUserId(this.Name, name != null ?
                    name.Value : null),
                AccessToken = providerAccessToken != null ?
                    providerAccessToken.Value : null
            };

            return credentials;
        }
示例#2
0
        public override ProviderCredentials CreateCredentials(
            ClaimsIdentity claimsIdentity)
        {
            Claim name = claimsIdentity.FindFirst(ClaimTypes.NameIdentifier);
            Claim providerAccessToken = claimsIdentity
                                        .FindFirst(ServiceClaimTypes.ProviderAccessToken);

            LinkedInCredentials credentials = new LinkedInCredentials
            {
                UserId = this.TokenHandler.CreateUserId(this.Name, name != null ?
                                                        name.Value : null),
                AccessToken = providerAccessToken != null ?
                              providerAccessToken.Value : null
            };

            return(credentials);
        }