CredentialsAuthProvider
Assembly: ServiceStack.dll
Declaration
public class CredentialsAuthProvider : AuthProvider, IAuthProvider, IAuthPlugin
Properties
Type
Declaration
public override string Type { get; }
SkipPasswordVerificationForInProcessRequests
Declaration
public bool SkipPasswordVerificationForInProcessRequests { get; set; }
Inherited Properties
AccountLockedValidator
Declaration
public Func<IAuthRepository, IUserAuth, IAuthTokens, bool> AccountLockedValidator { get; set; }
AuthEvents
Declaration
public IAuthEvents AuthEvents { get; }
AuthRealm
Declaration
public string AuthRealm { get; set; }
CallbackUrl
Declaration
public string CallbackUrl { get; set; }
CustomValidationFilter
Declaration
public Func<AuthContext, IHttpResult> CustomValidationFilter { get; set; }
ExcludeAuthInfoItems
Declaration
public HashSet<string> ExcludeAuthInfoItems { get; set; }
Declaration
public List<InputInfo> FormLayout { get; set; }
Icon
Declaration
public ImageInfo Icon { get; set; }
Label
Declaration
public string Label { get; set; }
LoadUserAuthFilter
Declaration
public Action<AuthUserSession, IAuthTokens, Dictionary<string, string>> LoadUserAuthFilter { get; set; }
LoadUserAuthInfoFilterAsync
Declaration
public Func<AuthUserSession, IAuthTokens, Dictionary<string, string>, CancellationToken, Task> LoadUserAuthInfoFilterAsync { get; set; }
Declaration
public virtual Dictionary<string, string> Meta { get; }
NavItem
Declaration
public NavItem NavItem { get; set; }
PersistSession
Declaration
public bool PersistSession { get; set; }
Provider
Declaration
public string Provider { get; set; }
RedirectUrl
Declaration
public string RedirectUrl { get; set; }
RestoreSessionFromState
Declaration
public bool? RestoreSessionFromState { get; set; }
SaveExtendedUserInfo
Declaration
public bool SaveExtendedUserInfo { get; set; }
SessionExpiry
Declaration
public TimeSpan? SessionExpiry { get; set; }
Sort
Declaration
public int Sort { get; set; }
Type
Declaration
public virtual string Type { get; }
Fields
Name
Declaration
public static string Name
Realm
Declaration
public static string Realm
Methods
Init()
Declaration
protected virtual void Init()
TryAuthenticateAsync(IServiceBase, String, String, CancellationToken)
Declaration
public virtual async Task<bool> TryAuthenticateAsync(IServiceBase authService, string userName, string password, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|
ServiceStack.IServiceBase | authService |
System.String | userName |
System.String | password |
System.Threading.CancellationToken | token |
IsAuthorized(IAuthSession, IAuthTokens, Authenticate)
Declaration
public override bool IsAuthorized(IAuthSession session, IAuthTokens tokens, Authenticate request = null)
Returns
System.Boolean
Parameters
AuthenticateAsync(IServiceBase, IAuthSession, Authenticate, CancellationToken)
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
ResetSessionBeforeLoginAsync(IServiceBase, IAuthSession, String, CancellationToken)
Declaration
protected virtual async Task<IAuthSession> ResetSessionBeforeLoginAsync(IServiceBase authService, IAuthSession session, string userName, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<ServiceStack.Auth.IAuthSession>
Parameters
AuthenticateAsync(IServiceBase, IAuthSession, String, String, String, CancellationToken)
Declaration
protected async Task<object> AuthenticateAsync(IServiceBase authService, IAuthSession session, string userName, string password, string referrerUrl, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
AuthenticatePrivateRequestAsync(IServiceBase, IAuthSession, String, String, String, CancellationToken)
Declaration
protected virtual async Task<object> AuthenticatePrivateRequestAsync(IServiceBase authService, IAuthSession session, string userName, string password, string referrerUrl, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Inherited Methods
AuthenticateAsync(IServiceBase, IAuthSession, Authenticate, CancellationToken)
Declaration
public abstract Task<object> AuthenticateAsync(IServiceBase authService, IAuthSession session, Authenticate request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
ConvertToClientError(Object, Boolean)
Declaration
protected virtual object ConvertToClientError(object failedResult, bool isHtml)
Returns
System.Object
Parameters
Type | Name |
---|
System.Object | failedResult |
System.Boolean | isHtml |
CreateAuthContext(IServiceBase, IAuthSession, IAuthTokens)
Declaration
protected virtual AuthContext CreateAuthContext(IServiceBase authService = null, IAuthSession session = null, IAuthTokens tokens = null)
Returns
ServiceStack.Auth.AuthContext
Parameters
CreateOrMergeAuthSession(IAuthSession, IAuthTokens)
Declaration
public virtual string CreateOrMergeAuthSession(IAuthSession session, IAuthTokens tokens)
Returns
System.String
Parameters
EmailAlreadyExistsAsync(IAuthRepositoryAsync, IUserAuth, IAuthTokens, CancellationToken)
Declaration
protected virtual async Task<bool> EmailAlreadyExistsAsync(IAuthRepositoryAsync authRepo, IUserAuth userAuth, IAuthTokens tokens = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
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"
Declaration
protected string FallbackConfig(string fallback)
Returns
System.String
Parameters
Type | Name |
---|
System.String | fallback |
GetAuthRedirectUrl(IServiceBase, IAuthSession)
Declaration
protected virtual string GetAuthRedirectUrl(IServiceBase authService, IAuthSession session)
Returns
System.String
Parameters
GetAuthRepository(IRequest)
Declaration
protected virtual IAuthRepository GetAuthRepository(IRequest req)
Returns
ServiceStack.Auth.IAuthRepository
Parameters
GetAuthRepositoryAsync(IRequest)
Declaration
protected virtual IAuthRepositoryAsync GetAuthRepositoryAsync(IRequest req)
Returns
ServiceStack.Auth.IAuthRepositoryAsync
Parameters
GetReferrerUrl(IServiceBase, IAuthSession, Authenticate)
Declaration
protected virtual string GetReferrerUrl(IServiceBase authService, IAuthSession session, Authenticate request = null)
Returns
System.String
Parameters
GetUserAuthRepositoryAsync(IRequest)
Declaration
public IUserAuthRepositoryAsync GetUserAuthRepositoryAsync(IRequest request)
Returns
ServiceStack.Auth.IUserAuthRepositoryAsync
Parameters
IsAccountLockedAsync(IAuthRepositoryAsync, IUserAuth, IAuthTokens, CancellationToken)
Declaration
public virtual Task<bool> IsAccountLockedAsync(IAuthRepositoryAsync authRepoAsync, IUserAuth userAuth, IAuthTokens tokens = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
IsAuthorized(IAuthSession, IAuthTokens, Authenticate)
Declaration
public abstract bool IsAuthorized(IAuthSession session, IAuthTokens tokens, Authenticate request = null)
Returns
System.Boolean
Parameters
LoadUserAuthInfo(AuthUserSession, IAuthTokens, Dictionary<String, String>)
Declaration
[Obsolete("Use LoadUserAuthInfoAsync")]
protected void LoadUserAuthInfo(AuthUserSession userSession, IAuthTokens tokens, Dictionary<string, string> authInfo)
Parameters
LoadUserAuthInfoAsync(AuthUserSession, IAuthTokens, Dictionary<String, String>, CancellationToken)
Declaration
protected virtual Task LoadUserAuthInfoAsync(AuthUserSession userSession, IAuthTokens tokens, Dictionary<string, string> authInfo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
LoginMatchesSession(IAuthSession, String)
Declaration
protected static bool LoginMatchesSession(IAuthSession session, string userName)
Returns
System.Boolean
Parameters
LogoutAsync(IServiceBase, Authenticate, CancellationToken)
Remove the Users Session
Declaration
public virtual async Task<object> LogoutAsync(IServiceBase service, Authenticate request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
OnAuthenticatedAsync(IServiceBase, IAuthSession, IAuthTokens, Dictionary<String, String>, CancellationToken)
Declaration
public virtual async Task<IHttpResult> OnAuthenticatedAsync(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary<string, string> authInfo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<ServiceStack.Web.IHttpResult>
Parameters
OnFailedAuthentication(IAuthSession, IRequest, IResponse)
Declaration
public virtual Task OnFailedAuthentication(IAuthSession session, IRequest httpReq, IResponse httpRes)
Returns
System.Threading.Tasks.Task
Parameters
Register(IAppHost, AuthFeature)
Declaration
public virtual void Register(IAppHost appHost, AuthFeature feature)
Parameters
UrlFilter(AuthContext, String)
Declaration
public static string UrlFilter(AuthContext provider, string url)
Returns
System.String
Parameters
UserNameAlreadyExistsAsync(IAuthRepositoryAsync, IUserAuth, IAuthTokens, CancellationToken)
Declaration
protected virtual async Task<bool> UserNameAlreadyExistsAsync(IAuthRepositoryAsync authRepo, IUserAuth userAuth, IAuthTokens tokens = null, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
ValidateAccountAsync(IServiceBase, IAuthRepositoryAsync, IAuthSession, IAuthTokens, CancellationToken)
Declaration
protected virtual async Task<IHttpResult> ValidateAccountAsync(IServiceBase authService, IAuthRepositoryAsync authRepo, IAuthSession session, IAuthTokens tokens, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<ServiceStack.Web.IHttpResult>
Parameters
Implements