OAuth2ProviderSync
Assembly: ServiceStack.dll
View Source
Declaration
public abstract class OAuth2ProviderSync : OAuthProviderSync, IAuthPlugin, IOAuthProvider, IAuthProvider
Properties
Scopes
View Source
Declaration
public string[] Scopes { get; set; }
ResponseMode
View Source
Declaration
public string ResponseMode { get; set; }
Inherited Properties
AccessTokenUrl
View Source
Declaration
public string AccessTokenUrl { get; set; }
AuthHttpGateway
View Source
Declaration
public IAuthHttpGateway AuthHttpGateway { get; set; }
AuthorizeUrl
View Source
Declaration
public string AuthorizeUrl { get; set; }
ConsumerKey
View Source
Declaration
public string ConsumerKey { get; set; }
ConsumerSecret
View Source
Declaration
public string ConsumerSecret { get; set; }
IssuerSigningKeysUrl
View Source
Declaration
public string IssuerSigningKeysUrl { get; set; }
Meta
View Source
Declaration
public override Dictionary<string, string> Meta { get; }
OAuthUtils
View Source
Declaration
public OAuthAuthorizer OAuthUtils { get; set; }
RequestTokenUrl
View Source
Declaration
public string RequestTokenUrl { get; set; }
Type
View Source
Declaration
public override string Type { get; }
UserProfileUrl
View Source
Declaration
public string UserProfileUrl { get; set; }
VerifyAccessToken
View Source
Declaration
public Func<string, bool> VerifyAccessToken { get; set; }
VerifyTokenUrl
View Source
Declaration
public string VerifyTokenUrl { get; set; }
Methods
AssertValidState()
View Source
Declaration
protected override void AssertValidState()
AssertAccessTokenUrl()
View Source
Declaration
protected virtual void AssertAccessTokenUrl()
AssertAuthorizeUrl()
View Source
Declaration
protected virtual void AssertAuthorizeUrl()
Authenticate(IServiceBase, IAuthSession, Authenticate)
View Source
Declaration
public override object Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
GetAccessTokenJson(String)
View Source
Declaration
protected virtual string GetAccessTokenJson(string code)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | code |
AuthenticateWithAccessToken(IServiceBase, IAuthSession, IAuthTokens, String, Dictionary<String, String>)
View Source
Declaration
protected virtual object AuthenticateWithAccessToken(IServiceBase authService, IAuthSession session, IAuthTokens tokens, string accessToken, Dictionary<string, string> authInfo = null)
Returns
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 |
CreateAuthInfo(String)
View Source
Declaration
protected abstract Dictionary<string, string> CreateAuthInfo(string accessToken)
Returns
System.Collections.Generic.Dictionary<System.String,System.String>
Parameters
Type | Name |
---|---|
System.String | accessToken |
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 |
LoadUserAuthInfo(AuthUserSession, IAuthTokens, Dictionary<String, String>)
View Source
Declaration
protected override void LoadUserAuthInfo(AuthUserSession userSession, IAuthTokens tokens, Dictionary<string, string> authInfo)
Parameters
Type | Name |
---|---|
ServiceStack.AuthUserSession | userSession |
ServiceStack.Auth.IAuthTokens | tokens |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
LoadUserOAuthProvider(IAuthSession, IAuthTokens)
View Source
Declaration
public override void LoadUserOAuthProvider(IAuthSession authSession, IAuthTokens tokens)
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | authSession |
ServiceStack.Auth.IAuthTokens | tokens |
Inherited Methods
AssertConsumerKey()
View Source
Declaration
protected virtual void AssertConsumerKey()
AssertConsumerSecret()
View Source
Declaration
protected virtual void AssertConsumerSecret()
AssertValidState()
View Source
Declaration
protected virtual void AssertValidState()
Authenticate(IServiceBase, IAuthSession, Authenticate)
The entry point for all AuthProvider providers. Runs inside the AuthService so exceptions are treated normally. Overridable so you can provide your own Auth implementation.
View Source
Declaration
public abstract override object Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
Init(IServiceBase, ref IAuthSession, Authenticate)
Sets the CallbackUrl and session.ReferrerUrl if not set and initializes the session tokens for this AuthProvider
View Source
Declaration
protected IAuthTokens Init(IServiceBase authService, ref IAuthSession session, Authenticate request)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
IsAuthorized(IAuthSession, IAuthTokens, Authenticate)
View Source
Declaration
public override bool IsAuthorized(IAuthSession session, IAuthTokens tokens, Authenticate request = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
ServiceStack.Authenticate | request |
LoadUserOAuthProvider(IAuthSession, IAuthTokens)
View Source
Declaration
public virtual void LoadUserOAuthProvider(IAuthSession userSession, IAuthTokens tokens)
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | userSession |
ServiceStack.Auth.IAuthTokens | tokens |