Skip to main content

MongoDbAuthRepository

Assembly: ServiceStack.Authentication.MongoDb.dll
View Source
Declaration
public class MongoDbAuthRepository : object, IUserAuthRepository, IAuthRepository, IClearable, IManageApiKeys, IQueryUserAuth, IUserAuthRepositoryAsync, IAuthRepositoryAsync, IClearableAsync, IManageApiKeysAsync, IQueryUserAuthAsync

Methods

CollectionsExists()

View Source
Declaration
public bool CollectionsExists()
Returns

System.Boolean

CreateMissingCollections()

View Source
Declaration
public void CreateMissingCollections()

DropAndReCreateCollections()

View Source
Declaration
public void DropAndReCreateCollections()

CreateUserAuth(IUserAuth, String)

View Source
Declaration
public IUserAuth CreateUserAuth(IUserAuth newUser, string password)
Returns

ServiceStack.Auth.IUserAuth

Parameters
TypeName
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword

UpdateUserAuth(IUserAuth, IUserAuth, String)

View Source
Declaration
public IUserAuth UpdateUserAuth(IUserAuth existingUser, IUserAuth newUser, string password)
Returns

ServiceStack.Auth.IUserAuth

Parameters
TypeName
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword

UpdateUserAuth(IUserAuth, IUserAuth)

View Source
Declaration
public IUserAuth UpdateUserAuth(IUserAuth existingUser, IUserAuth newUser)
Returns

ServiceStack.Auth.IUserAuth

Parameters
TypeName
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser

GetUserAuthByUserName(String)

View Source
Declaration
public IUserAuth GetUserAuthByUserName(string userNameOrEmail)
Returns

ServiceStack.Auth.IUserAuth

Parameters
TypeName
System.StringuserNameOrEmail

GetUserAuths(String, Nullable<Int32>, Nullable<Int32>)

View Source
Declaration
public List<IUserAuth> GetUserAuths(string orderBy = null, int? skip = null, int? take = null)
Returns

List<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take

SearchUserAuths(String, String, Nullable<Int32>, Nullable<Int32>)

View Source
Declaration
public List<IUserAuth> SearchUserAuths(string query, string orderBy = null, int? skip = null, int? take = null)
Returns

List<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
System.Stringquery
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take

TryAuthenticate(String, String, out IUserAuth)

View Source
Declaration
public bool TryAuthenticate(string userName, string password, out IUserAuth userAuth)
Returns

System.Boolean

Parameters
TypeName
System.StringuserName
System.Stringpassword
ServiceStack.Auth.IUserAuthuserAuth

TryAuthenticate(Dictionary<String, String>, String, Int32, String, out IUserAuth)

View Source
Declaration
public bool TryAuthenticate(Dictionary<string, string> digestHeaders, string privateKey, int nonceTimeOut, string sequence, out IUserAuth userAuth)
Returns

System.Boolean

Parameters
TypeName
Dictionary<System.String,System.String>digestHeaders
System.StringprivateKey
System.Int32nonceTimeOut
System.Stringsequence
ServiceStack.Auth.IUserAuthuserAuth

LoadUserAuth(IAuthSession, IAuthTokens)

View Source
Declaration
public void LoadUserAuth(IAuthSession session, IAuthTokens tokens)
Parameters
TypeName
ServiceStack.Auth.IAuthSessionsession
ServiceStack.Auth.IAuthTokenstokens

GetUserAuth(String)

View Source
Declaration
public IUserAuth GetUserAuth(string userAuthId)
Returns

ServiceStack.Auth.IUserAuth

Parameters
TypeName
System.StringuserAuthId

SaveUserAuth(IAuthSession)

View Source
Declaration
public void SaveUserAuth(IAuthSession authSession)
Parameters
TypeName
ServiceStack.Auth.IAuthSessionauthSession

SaveUserAuth(IUserAuth)

View Source
Declaration
public void SaveUserAuth(IUserAuth userAuth)
Parameters
TypeName
ServiceStack.Auth.IUserAuthuserAuth

DeleteUserAuth(String)

View Source
Declaration
public void DeleteUserAuth(string userAuthId)
Parameters
TypeName
System.StringuserAuthId

GetUserAuthDetails(String)

View Source
Declaration
public List<IUserAuthDetails> GetUserAuthDetails(string userAuthId)
Returns

List<ServiceStack.Auth.IUserAuthDetails>

Parameters
TypeName
System.StringuserAuthId

GetUserAuth(IAuthSession, IAuthTokens)

View Source
Declaration
public IUserAuth GetUserAuth(IAuthSession authSession, IAuthTokens tokens)
Returns

ServiceStack.Auth.IUserAuth

Parameters
TypeName
ServiceStack.Auth.IAuthSessionauthSession
ServiceStack.Auth.IAuthTokenstokens

CreateOrMergeAuthSession(IAuthSession, IAuthTokens)

View Source
Declaration
public IUserAuthDetails CreateOrMergeAuthSession(IAuthSession authSession, IAuthTokens tokens)
Returns

ServiceStack.Auth.IUserAuthDetails

Parameters
TypeName
ServiceStack.Auth.IAuthSessionauthSession
ServiceStack.Auth.IAuthTokenstokens

Clear()

View Source
Declaration
public void Clear()

InitApiKeySchema()

View Source
Declaration
public void InitApiKeySchema()

ApiKeyExists(String)

View Source
Declaration
public bool ApiKeyExists(string apiKey)
Returns

System.Boolean

Parameters
TypeName
System.StringapiKey

GetApiKey(String)

View Source
Declaration
public ApiKey GetApiKey(string apiKey)
Returns

ServiceStack.Auth.ApiKey

Parameters
TypeName
System.StringapiKey

GetUserApiKeys(String)

View Source
Declaration
public List<ApiKey> GetUserApiKeys(string userId)
Returns

List<ServiceStack.Auth.ApiKey>

Parameters
TypeName
System.StringuserId

StoreAll(IEnumerable<ApiKey>)

View Source
Declaration
public void StoreAll(IEnumerable<ApiKey> apiKeys)
Parameters
TypeName
IEnumerable<ServiceStack.Auth.ApiKey>apiKeys

CreateUserAuthAsync(IUserAuth, String, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> CreateUserAuthAsync(IUserAuth newUser, string password, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword
CancellationTokentoken

UpdateUserAuthAsync(IUserAuth, IUserAuth, String, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> UpdateUserAuthAsync(IUserAuth existingUser, IUserAuth newUser, string password, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser
System.Stringpassword
CancellationTokentoken

UpdateUserAuthAsync(IUserAuth, IUserAuth, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> UpdateUserAuthAsync(IUserAuth existingUser, IUserAuth newUser, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
ServiceStack.Auth.IUserAuthexistingUser
ServiceStack.Auth.IUserAuthnewUser
CancellationTokentoken

GetUserAuthByUserNameAsync(String, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> GetUserAuthByUserNameAsync(string userNameOrEmail, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
System.StringuserNameOrEmail
CancellationTokentoken

GetUserAuthsAsync(String, Nullable<Int32>, Nullable<Int32>, CancellationToken)

View Source
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
TypeName
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take
CancellationTokentoken

SearchUserAuthsAsync(String, String, Nullable<Int32>, Nullable<Int32>, CancellationToken)

View Source
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
TypeName
System.Stringquery
System.StringorderBy
System.Nullable<System.Int32>skip
System.Nullable<System.Int32>take
CancellationTokentoken

TryAuthenticateAsync(String, String, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> TryAuthenticateAsync(string userName, string password, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
System.StringuserName
System.Stringpassword
CancellationTokentoken

TryAuthenticateAsync(Dictionary<String, String>, String, Int32, String, CancellationToken)

View Source
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
TypeName
Dictionary<System.String,System.String>digestHeaders
System.StringprivateKey
System.Int32nonceTimeOut
System.Stringsequence
CancellationTokentoken

LoadUserAuthAsync(IAuthSession, IAuthTokens, CancellationToken)

View Source
Declaration
public async Task LoadUserAuthAsync(IAuthSession session, IAuthTokens tokens, CancellationToken token = null)
Returns

Task

Parameters
TypeName
ServiceStack.Auth.IAuthSessionsession
ServiceStack.Auth.IAuthTokenstokens
CancellationTokentoken

GetUserAuthAsync(String, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> GetUserAuthAsync(string userAuthId, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
System.StringuserAuthId
CancellationTokentoken

SaveUserAuthAsync(IAuthSession, CancellationToken)

View Source
Declaration
public async Task SaveUserAuthAsync(IAuthSession authSession, CancellationToken token = null)
Returns

Task

Parameters
TypeName
ServiceStack.Auth.IAuthSessionauthSession
CancellationTokentoken

SaveUserAuthAsync(IUserAuth, CancellationToken)

View Source
Declaration
public async Task SaveUserAuthAsync(IUserAuth userAuth, CancellationToken token = null)
Returns

Task

Parameters
TypeName
ServiceStack.Auth.IUserAuthuserAuth
CancellationTokentoken

DeleteUserAuthAsync(String, CancellationToken)

View Source
Declaration
public async Task DeleteUserAuthAsync(string userAuthId, CancellationToken token = null)
Returns

Task

Parameters
TypeName
System.StringuserAuthId
CancellationTokentoken

GetUserAuthDetailsAsync(String, CancellationToken)

View Source
Declaration
public async Task<List<IUserAuthDetails>> GetUserAuthDetailsAsync(string userAuthId, CancellationToken token = null)
Returns

Task<List<ServiceStack.Auth.IUserAuthDetails>>

Parameters
TypeName
System.StringuserAuthId
CancellationTokentoken

GetUserAuthAsync(IAuthSession, IAuthTokens, CancellationToken)

View Source
Declaration
public async Task<IUserAuth> GetUserAuthAsync(IAuthSession authSession, IAuthTokens tokens, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuth>

Parameters
TypeName
ServiceStack.Auth.IAuthSessionauthSession
ServiceStack.Auth.IAuthTokenstokens
CancellationTokentoken

CreateOrMergeAuthSessionAsync(IAuthSession, IAuthTokens, CancellationToken)

View Source
Declaration
public async Task<IUserAuthDetails> CreateOrMergeAuthSessionAsync(IAuthSession authSession, IAuthTokens tokens, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.IUserAuthDetails>

Parameters
TypeName
ServiceStack.Auth.IAuthSessionauthSession
ServiceStack.Auth.IAuthTokenstokens
CancellationTokentoken

CreateMissingCollectionsAsync(CancellationToken)

View Source
Declaration
public async Task CreateMissingCollectionsAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

DropAndReCreateCollectionsAsync(CancellationToken)

View Source
Declaration
public async Task DropAndReCreateCollectionsAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

ClearAsync(CancellationToken)

View Source
Declaration
public async Task ClearAsync(CancellationToken token = null)
Returns

Task

Parameters
TypeName
CancellationTokentoken

ApiKeyExistsAsync(String, CancellationToken)

View Source
Declaration
public async Task<bool> ApiKeyExistsAsync(string apiKey, CancellationToken token = null)
Returns

Task<System.Boolean>

Parameters
TypeName
System.StringapiKey
CancellationTokentoken

GetApiKeyAsync(String, CancellationToken)

View Source
Declaration
public async Task<ApiKey> GetApiKeyAsync(string apiKey, CancellationToken token = null)
Returns

Task<ServiceStack.Auth.ApiKey>

Parameters
TypeName
System.StringapiKey
CancellationTokentoken

GetUserApiKeysAsync(String, CancellationToken)

View Source
Declaration
public async Task<List<ApiKey>> GetUserApiKeysAsync(string userId, CancellationToken token = null)
Returns

Task<List<ServiceStack.Auth.ApiKey>>

Parameters
TypeName
System.StringuserId
CancellationTokentoken

StoreAllAsync(IEnumerable<ApiKey>, CancellationToken)

View Source
Declaration
public async Task StoreAllAsync(IEnumerable<ApiKey> apiKeys, CancellationToken token = null)
Returns

Task

Parameters
TypeName
IEnumerable<ServiceStack.Auth.ApiKey>apiKeys
CancellationTokentoken

Implements