Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }