AuthProviderSync
Sync AuthProvider base class for compatibility with Sync Auth Providers
Assembly: ServiceStack.dll
View Source
Declaration
public abstract class AuthProviderSync : IAuthProvider, IAuthPlugin
Properties
Type
View Source
Declaration
public virtual string Type { get; }
Meta
View Source
Declaration
public virtual Dictionary<string, string> Meta { get; }
SessionExpiry
View Source
Declaration
public TimeSpan? SessionExpiry { get; set; }
AuthRealm
View Source
Declaration
public string AuthRealm { get; set; }
Provider
View Source
Declaration
public string Provider { get; set; }
CallbackUrl
View Source
Declaration
public string CallbackUrl { get; set; }
RedirectUrl
View Source
Declaration
public string RedirectUrl { get; set; }
PersistSession
View Source
Declaration
public bool PersistSession { get; set; }
SaveExtendedUserInfo
View Source
Declaration
public bool SaveExtendedUserInfo { get; set; }
RestoreSessionFromState
View Source
Declaration
public bool? RestoreSessionFromState { get; set; }
LoadUserAuthFilter
View Source
Declaration
public Action<AuthUserSession, IAuthTokens, Dictionary<string, string>> LoadUserAuthFilter { get; set; }
CustomValidationFilter
View Source
Declaration
public Func<AuthContext, IHttpResult> CustomValidationFilter { get; set; }
AccountLockedValidator
View Source
Declaration
public Func<IAuthRepository, IUserAuth, IAuthTokens, bool> AccountLockedValidator { get; set; }
NavItem
View Source
Declaration
public NavItem NavItem { get; set; }
AuthEvents
View Source
Declaration
public IAuthEvents AuthEvents { get; }
ExcludeAuthInfoItems
View Source
Declaration
public HashSet<string> ExcludeAuthInfoItems { get; set; }
Fields
Log
View Source
Declaration
protected static readonly ILog Log
PreAuthUrlFilter
View Source
Declaration
public Func<AuthProviderSync, string, string> PreAuthUrlFilter
AccessTokenUrlFilter
View Source
Declaration
public Func<AuthProviderSync, string, string> AccessTokenUrlFilter
SuccessRedirectUrlFilter
View Source
Declaration
public Func<AuthProviderSync, string, string> SuccessRedirectUrlFilter
FailedRedirectUrlFilter
View Source
Declaration
public Func<AuthProviderSync, string, string> FailedRedirectUrlFilter
LogoutUrlFilter
View Source
Declaration
public Func<AuthProviderSync, string, string> LogoutUrlFilter
Methods
UrlFilter(AuthProviderSync, String)
View Source
Declaration
public static string UrlFilter(AuthProviderSync provider, string url)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Auth.AuthProviderSync | provider |
System.String | url |
FallbackConfig(String)
Allows specifying a global fallback config that if exists is formatted with the Provider as the first arg. E.g. this appSetting with the TwitterAuthProvider: oauth.CallbackUrl="http://localhost:11001/auth/{0}" Would result in: oauth.CallbackUrl="http://localhost:11001/auth/twitter"
View Source
Declaration
protected string FallbackConfig(string fallback)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | fallback |
Logout(IServiceBase, Authenticate)
Remove the Users Session
View Source
Declaration
public virtual object Logout(IServiceBase service, Authenticate request)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | service |
ServiceStack.Authenticate | request |
OnAuthenticated(IServiceBase, IAuthSession, IAuthTokens, Dictionary<String, String>)
View Source
Declaration
public virtual IHttpResult OnAuthenticated(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary<string, string> authInfo)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
GetAuthRepository(IRequest)
View Source
Declaration
protected virtual IAuthRepository GetAuthRepository(IRequest req)
Returns
ServiceStack.Auth.IAuthRepository
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | req |
CreateOrMergeAuthSession(IAuthSession, IAuthTokens)
View Source
Declaration
public virtual string CreateOrMergeAuthSession(IAuthSession session, IAuthTokens tokens)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
LoadUserAuthInfo(AuthUserSession, IAuthTokens, Dictionary<String, String>)
View Source
Declaration
protected virtual 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 |
LoginMatchesSession(IAuthSession, String)
View Source
Declaration
protected static bool LoginMatchesSession(IAuthSession session, string userName)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.String | userName |
LogoutAsync(IServiceBase, Authenticate, CancellationToken)
View Source
Declaration
public Task<object> LogoutAsync(IServiceBase service, Authenticate request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | service |
ServiceStack.Authenticate | request |
System.Threading.CancellationToken | token |
AuthenticateAsync(IServiceBase, IAuthSession, Authenticate, CancellationToken)
View Source
Declaration
public 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 |
IsAuthorized(IAuthSession, IAuthTokens, Authenticate)
View Source
Declaration
public abstract 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 |
Authenticate(IServiceBase, IAuthSession, Authenticate)
View Source
Declaration
public abstract object Authenticate(IServiceBase authService, IAuthSession session, Authenticate request)
Returns
System.Object
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
OnFailedAuthentication(IAuthSession, IRequest, IResponse)
View Source
Declaration
public virtual Task OnFailedAuthentication(IAuthSession session, IRequest httpReq, IResponse httpRes)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Web.IRequest | httpReq |
ServiceStack.Web.IResponse | httpRes |
UserNameAlreadyExists(IAuthRepository, IUserAuth, IAuthTokens)
View Source
Declaration
protected virtual bool UserNameAlreadyExists(IAuthRepository authRepo, IUserAuth userAuth, IAuthTokens tokens = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepository | authRepo |
ServiceStack.Auth.IUserAuth | userAuth |
ServiceStack.Auth.IAuthTokens | tokens |
EmailAlreadyExists(IAuthRepository, IUserAuth, IAuthTokens)
View Source
Declaration
protected virtual bool EmailAlreadyExists(IAuthRepository authRepo, IUserAuth userAuth, IAuthTokens tokens = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepository | authRepo |
ServiceStack.Auth.IUserAuth | userAuth |
ServiceStack.Auth.IAuthTokens | tokens |
GetAuthRedirectUrl(IServiceBase, IAuthSession)
View Source
Declaration
protected virtual string GetAuthRedirectUrl(IServiceBase authService, IAuthSession session)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
IsAccountLocked(IAuthRepository, IUserAuth, IAuthTokens)
View Source
Declaration
public virtual bool IsAccountLocked(IAuthRepository authRepo, IUserAuth userAuth, IAuthTokens tokens = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepository | authRepo |
ServiceStack.Auth.IUserAuth | userAuth |
ServiceStack.Auth.IAuthTokens | tokens |
ValidateAccount(IServiceBase, IAuthRepository, IAuthSession, IAuthTokens)
View Source
Declaration
protected virtual IHttpResult ValidateAccount(IServiceBase authService, IAuthRepository authRepo, IAuthSession session, IAuthTokens tokens)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthRepository | authRepo |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
GetReferrerUrl(IServiceBase, IAuthSession, Authenticate)
View Source
Declaration
protected virtual string GetReferrerUrl(IServiceBase authService, IAuthSession session, Authenticate request = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
ConvertToClientError(Object, Boolean)
View Source
Declaration
protected virtual object ConvertToClientError(object failedResult, bool isHtml)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.Object | failedResult |
System.Boolean | isHtml |
Register(IAppHost, AuthFeature)
View Source
Declaration
public virtual void Register(IAppHost appHost, AuthFeature feature)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
ServiceStack.AuthFeature | feature |