MongoDbAuthRepository
Assembly: ServiceStack.Authentication.MongoDb.dll
Declaration
public class MongoDbAuthRepository : object, IUserAuthRepository, IAuthRepository, IClearable, IManageApiKeys, IQueryUserAuth, IUserAuthRepositoryAsync, IAuthRepositoryAsync, IClearableAsync, IManageApiKeysAsync, IQueryUserAuthAsync
Methods
CollectionsExists()
Declaration
public bool CollectionsExists()
Returns
System.Boolean
CreateMissingCollections()
Declaration
public void CreateMissingCollections()
DropAndReCreateCollections()
Declaration
public void DropAndReCreateCollections()
CreateUserAuth(IUserAuth, String)
Declaration
public IUserAuth CreateUserAuth(IUserAuth newUser, string password)
Returns
ServiceStack.Auth.IUserAuth
Parameters
UpdateUserAuth(IUserAuth, IUserAuth, String)
Declaration
public IUserAuth UpdateUserAuth(IUserAuth existingUser, IUserAuth newUser, string password)
Returns
ServiceStack.Auth.IUserAuth
Parameters
UpdateUserAuth(IUserAuth, IUserAuth)
Declaration
public IUserAuth UpdateUserAuth(IUserAuth existingUser, IUserAuth newUser)
Returns
ServiceStack.Auth.IUserAuth
Parameters
GetUserAuthByUserName(String)
Declaration
public IUserAuth GetUserAuthByUserName(string userNameOrEmail)
Returns
ServiceStack.Auth.IUserAuth
Parameters
Type | Name |
---|
System.String | userNameOrEmail |
GetUserAuths(String, Nullable<Int32>, Nullable<Int32>)
Declaration
public List<IUserAuth> GetUserAuths(string orderBy = null, int? skip = null, int? take = null)
Returns
List<ServiceStack.Auth.IUserAuth>
Parameters
Type | Name |
---|
System.String | orderBy |
System.Nullable<System.Int32> | skip |
System.Nullable<System.Int32> | take |
SearchUserAuths(String, String, Nullable<Int32>, Nullable<Int32>)
Declaration
public List<IUserAuth> SearchUserAuths(string query, string orderBy = null, int? skip = null, int? take = null)
Returns
List<ServiceStack.Auth.IUserAuth>
Parameters
Type | Name |
---|
System.String | query |
System.String | orderBy |
System.Nullable<System.Int32> | skip |
System.Nullable<System.Int32> | take |
TryAuthenticate(String, String, out IUserAuth)
Declaration
public bool TryAuthenticate(string userName, string password, out IUserAuth userAuth)
Returns
System.Boolean
Parameters
TryAuthenticate(Dictionary<String, String>, String, Int32, String, out IUserAuth)
Declaration
public bool TryAuthenticate(Dictionary<string, string> digestHeaders, string privateKey, int nonceTimeOut, string sequence, out IUserAuth userAuth)
Returns
System.Boolean
Parameters
Type | Name |
---|
Dictionary<System.String,System.String> | digestHeaders |
System.String | privateKey |
System.Int32 | nonceTimeOut |
System.String | sequence |
ServiceStack.Auth.IUserAuth | userAuth |
LoadUserAuth(IAuthSession, IAuthTokens)
Declaration
public void LoadUserAuth(IAuthSession session, IAuthTokens tokens)
Parameters
GetUserAuth(String)
Declaration
public IUserAuth GetUserAuth(string userAuthId)
Returns
ServiceStack.Auth.IUserAuth
Parameters
Type | Name |
---|
System.String | userAuthId |
SaveUserAuth(IAuthSession)
Declaration
public void SaveUserAuth(IAuthSession authSession)
Parameters
SaveUserAuth(IUserAuth)
Declaration
public void SaveUserAuth(IUserAuth userAuth)
Parameters
DeleteUserAuth(String)
Declaration
public void DeleteUserAuth(string userAuthId)
Parameters
Type | Name |
---|
System.String | userAuthId |
GetUserAuthDetails(String)
Declaration
public List<IUserAuthDetails> GetUserAuthDetails(string userAuthId)
Returns
List<ServiceStack.Auth.IUserAuthDetails>
Parameters
Type | Name |
---|
System.String | userAuthId |
GetUserAuth(IAuthSession, IAuthTokens)
Declaration
public IUserAuth GetUserAuth(IAuthSession authSession, IAuthTokens tokens)
Returns
ServiceStack.Auth.IUserAuth
Parameters
CreateOrMergeAuthSession(IAuthSession, IAuthTokens)
Declaration
public IUserAuthDetails CreateOrMergeAuthSession(IAuthSession authSession, IAuthTokens tokens)
Returns
ServiceStack.Auth.IUserAuthDetails
Parameters
Clear()
InitApiKeySchema()
Declaration
public void InitApiKeySchema()
ApiKeyExists(String)
Declaration
public bool ApiKeyExists(string apiKey)
Returns
System.Boolean
Parameters
Type | Name |
---|
System.String | apiKey |
GetApiKey(String)
Declaration
public ApiKey GetApiKey(string apiKey)
Returns
ServiceStack.Auth.ApiKey
Parameters
Type | Name |
---|
System.String | apiKey |
GetUserApiKeys(String)
Declaration
public List<ApiKey> GetUserApiKeys(string userId)
Returns
List<ServiceStack.Auth.ApiKey>
Parameters
Type | Name |
---|
System.String | userId |
StoreAll(IEnumerable<ApiKey>)
Declaration
public void StoreAll(IEnumerable<ApiKey> apiKeys)
Parameters
Type | Name |
---|
IEnumerable<ServiceStack.Auth.ApiKey> | apiKeys |
CreateUserAuthAsync(IUserAuth, String, CancellationToken)
Declaration
public async Task<IUserAuth> CreateUserAuthAsync(IUserAuth newUser, string password, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
UpdateUserAuthAsync(IUserAuth, IUserAuth, String, CancellationToken)
Declaration
public async Task<IUserAuth> UpdateUserAuthAsync(IUserAuth existingUser, IUserAuth newUser, string password, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
UpdateUserAuthAsync(IUserAuth, IUserAuth, CancellationToken)
Declaration
public async Task<IUserAuth> UpdateUserAuthAsync(IUserAuth existingUser, IUserAuth newUser, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
GetUserAuthByUserNameAsync(String, CancellationToken)
Declaration
public async Task<IUserAuth> GetUserAuthByUserNameAsync(string userNameOrEmail, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
Type | Name |
---|
System.String | userNameOrEmail |
CancellationToken | token |
GetUserAuthsAsync(String, Nullable<Int32>, Nullable<Int32>, CancellationToken)
Declaration
public async Task<List<IUserAuth>> GetUserAuthsAsync(string orderBy = null, int? skip = null, int? take = null, CancellationToken token = null)
Returns
Task<List<ServiceStack.Auth.IUserAuth>>
Parameters
Type | Name |
---|
System.String | orderBy |
System.Nullable<System.Int32> | skip |
System.Nullable<System.Int32> | take |
CancellationToken | token |
SearchUserAuthsAsync(String, String, Nullable<Int32>, Nullable<Int32>, CancellationToken)
Declaration
public async Task<List<IUserAuth>> SearchUserAuthsAsync(string query, string orderBy = null, int? skip = null, int? take = null, CancellationToken token = null)
Returns
Task<List<ServiceStack.Auth.IUserAuth>>
Parameters
Type | Name |
---|
System.String | query |
System.String | orderBy |
System.Nullable<System.Int32> | skip |
System.Nullable<System.Int32> | take |
CancellationToken | token |
TryAuthenticateAsync(String, String, CancellationToken)
Declaration
public async Task<IUserAuth> TryAuthenticateAsync(string userName, string password, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
Type | Name |
---|
System.String | userName |
System.String | password |
CancellationToken | token |
TryAuthenticateAsync(Dictionary<String, String>, String, Int32, String, CancellationToken)
Declaration
public async Task<IUserAuth> TryAuthenticateAsync(Dictionary<string, string> digestHeaders, string privateKey, int nonceTimeOut, string sequence, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
Type | Name |
---|
Dictionary<System.String,System.String> | digestHeaders |
System.String | privateKey |
System.Int32 | nonceTimeOut |
System.String | sequence |
CancellationToken | token |
LoadUserAuthAsync(IAuthSession, IAuthTokens, CancellationToken)
Declaration
public async Task LoadUserAuthAsync(IAuthSession session, IAuthTokens tokens, CancellationToken token = null)
Returns
Task
Parameters
GetUserAuthAsync(String, CancellationToken)
Declaration
public async Task<IUserAuth> GetUserAuthAsync(string userAuthId, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
Type | Name |
---|
System.String | userAuthId |
CancellationToken | token |
SaveUserAuthAsync(IAuthSession, CancellationToken)
Declaration
public async Task SaveUserAuthAsync(IAuthSession authSession, CancellationToken token = null)
Returns
Task
Parameters
SaveUserAuthAsync(IUserAuth, CancellationToken)
Declaration
public async Task SaveUserAuthAsync(IUserAuth userAuth, CancellationToken token = null)
Returns
Task
Parameters
DeleteUserAuthAsync(String, CancellationToken)
Declaration
public async Task DeleteUserAuthAsync(string userAuthId, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|
System.String | userAuthId |
CancellationToken | token |
GetUserAuthDetailsAsync(String, CancellationToken)
Declaration
public async Task<List<IUserAuthDetails>> GetUserAuthDetailsAsync(string userAuthId, CancellationToken token = null)
Returns
Task<List<ServiceStack.Auth.IUserAuthDetails>>
Parameters
Type | Name |
---|
System.String | userAuthId |
CancellationToken | token |
GetUserAuthAsync(IAuthSession, IAuthTokens, CancellationToken)
Declaration
public async Task<IUserAuth> GetUserAuthAsync(IAuthSession authSession, IAuthTokens tokens, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuth>
Parameters
CreateOrMergeAuthSessionAsync(IAuthSession, IAuthTokens, CancellationToken)
Declaration
public async Task<IUserAuthDetails> CreateOrMergeAuthSessionAsync(IAuthSession authSession, IAuthTokens tokens, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.IUserAuthDetails>
Parameters
CreateMissingCollectionsAsync(CancellationToken)
Declaration
public async Task CreateMissingCollectionsAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|
CancellationToken | token |
DropAndReCreateCollectionsAsync(CancellationToken)
Declaration
public async Task DropAndReCreateCollectionsAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|
CancellationToken | token |
ClearAsync(CancellationToken)
Declaration
public async Task ClearAsync(CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|
CancellationToken | token |
ApiKeyExistsAsync(String, CancellationToken)
Declaration
public async Task<bool> ApiKeyExistsAsync(string apiKey, CancellationToken token = null)
Returns
Task<System.Boolean>
Parameters
Type | Name |
---|
System.String | apiKey |
CancellationToken | token |
GetApiKeyAsync(String, CancellationToken)
Declaration
public async Task<ApiKey> GetApiKeyAsync(string apiKey, CancellationToken token = null)
Returns
Task<ServiceStack.Auth.ApiKey>
Parameters
Type | Name |
---|
System.String | apiKey |
CancellationToken | token |
GetUserApiKeysAsync(String, CancellationToken)
Declaration
public async Task<List<ApiKey>> GetUserApiKeysAsync(string userId, CancellationToken token = null)
Returns
Task<List<ServiceStack.Auth.ApiKey>>
Parameters
Type | Name |
---|
System.String | userId |
CancellationToken | token |
StoreAllAsync(IEnumerable<ApiKey>, CancellationToken)
Declaration
public async Task StoreAllAsync(IEnumerable<ApiKey> apiKeys, CancellationToken token = null)
Returns
Task
Parameters
Type | Name |
---|
IEnumerable<ServiceStack.Auth.ApiKey> | apiKeys |
CancellationToken | token |
Implements