LinkedInAuthProvider
Create new App at: https://www.linkedin.com/secure/developer
Assembly: ServiceStack.dll
View Source
Declaration
public class LinkedInAuthProvider : OAuth2Provider, IAuthPlugin, IOAuthProvider, IAuthProvider
Inherited Properties
ResolveUnknownDisplayName
Custom DisplayName resolver function when not provided
View Source
Declaration
public Func<IAuthSession, IAuthTokens, string> ResolveUnknownDisplayName { get; set; }
ResponseMode
View Source
Declaration
public string ResponseMode { get; set; }
Scopes
View Source
Declaration
public string[] Scopes { get; set; }
Fields
Name
View Source
Declaration
public const string Name = "linkedin"
Realm
View Source
Declaration
public const string Realm = "https://www.linkedin.com/uas/oauth2/authorization"
DefaultAuthorizeUrl
View Source
Declaration
public const string DefaultAuthorizeUrl = "https://www.linkedin.com/uas/oauth2/authorization"
DefaultAccessTokenUrl
View Source
Declaration
public const string DefaultAccessTokenUrl = "https://www.linkedin.com/uas/oauth2/accessToken"
DefaultUserProfileUrl
View Source
Declaration
public const string DefaultUserProfileUrl = "https://api.linkedin.com/v1/people/~:(id,email-address,formatted-name,first-name,last-name,date-of-birth,public-profile-url,picture-url)"
Methods
CreateAuthInfoAsync(String, CancellationToken)
View Source
Declaration
protected override async Task<Dictionary<string, string>> CreateAuthInfoAsync(string accessToken, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String,System.String>>
Parameters
Type | Name |
---|---|
System.String | accessToken |
System.Threading.CancellationToken | token |
Inherited Methods
AssertAccessTokenUrl()
View Source
Declaration
protected virtual void AssertAccessTokenUrl()
AssertAuthorizeUrl()
View Source
Declaration
protected virtual void AssertAuthorizeUrl()
AssertValidState()
View Source
Declaration
protected override void AssertValidState()
AuthenticateAsync(IServiceBase, IAuthSession, Authenticate, CancellationToken)
View Source
Declaration
public override async Task<object> AuthenticateAsync(IServiceBase authService, IAuthSession session, Authenticate request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
System.Threading.CancellationToken | token |
AuthenticateWithAccessTokenAsync(IServiceBase, IAuthSession, IAuthTokens, String, Dictionary<String, String>, CancellationToken)
View Source
Declaration
protected virtual async Task<object> AuthenticateWithAccessTokenAsync(IServiceBase authService, IAuthSession session, IAuthTokens tokens, string accessToken, Dictionary<string, string> authInfo = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
System.String | accessToken |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
System.Threading.CancellationToken | token |
CreateAuthInfoAsync(String, CancellationToken)
View Source
Declaration
protected abstract Task<Dictionary<string, string>> CreateAuthInfoAsync(string accessToken, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String,System.String>>
Parameters
Type | Name |
---|---|
System.String | accessToken |
System.Threading.CancellationToken | token |
GetAccessTokenJsonAsync(String, AuthContext, CancellationToken)
View Source
Declaration
protected virtual async Task<string> GetAccessTokenJsonAsync(string code, AuthContext ctx, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|---|
System.String | code |
ServiceStack.Auth.AuthContext | ctx |
System.Threading.CancellationToken | token |
GetUserAuthName(IAuthTokens, Dictionary<String, String>)
Override to return User chosen username or Email for this AuthProvider
View Source
Declaration
protected virtual string GetUserAuthName(IAuthTokens tokens, Dictionary<string, string> authInfo)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthTokens | tokens |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
LoadUserAuthInfoAsync(AuthUserSession, IAuthTokens, Dictionary<String, String>, CancellationToken)
View Source
Declaration
protected override Task LoadUserAuthInfoAsync(AuthUserSession userSession, IAuthTokens tokens, Dictionary<string, string> authInfo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.AuthUserSession | userSession |
ServiceStack.Auth.IAuthTokens | tokens |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
System.Threading.CancellationToken | token |
LoadUserOAuthProviderAsync(IAuthSession, IAuthTokens)
View Source
Declaration
public override Task LoadUserOAuthProviderAsync(IAuthSession authSession, IAuthTokens tokens)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | authSession |
ServiceStack.Auth.IAuthTokens | tokens |