AuthSessionExtensions
Assembly: ServiceStack.dll
View Source
Declaration
public static class AuthSessionExtensions
Methods
AddAuthToken(IAuthSession, IAuthTokens)
View Source
Declaration
public static void AddAuthToken(this IAuthSession session, IAuthTokens tokens)
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
GetAuthTokens(IAuthSession)
View Source
Declaration
public static List<IAuthTokens> GetAuthTokens(this IAuthSession session)
Returns
System.Collections.Generic.List<ServiceStack.Auth.IAuthTokens>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
GetAuthTokens(IAuthSession, String)
View Source
Declaration
public static IAuthTokens GetAuthTokens(this IAuthSession session, string provider)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.String | provider |
GetProfileUrl(IAuthSession, String)
View Source
Declaration
public static string GetProfileUrl(this IAuthSession authSession, string defaultUrl = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | authSession |
System.String | defaultUrl |
GetSafeDisplayName(IAuthSession)
View Source
Declaration
public static string GetSafeDisplayName(this IAuthSession authSession)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | authSession |
UpdateFromUserAuthRepoAsync(IAuthSession, IRequest, IAuthRepositoryAsync)
View Source
Declaration
public static async Task UpdateFromUserAuthRepoAsync(this IAuthSession session, IRequest req, IAuthRepositoryAsync authRepo = null)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Web.IRequest | req |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
UpdateFromUserAuthRepo(IAuthSession, IRequest, IAuthRepository)
View Source
Declaration
public static void UpdateFromUserAuthRepo(this IAuthSession session, IRequest req, IAuthRepository authRepo = null)
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Web.IRequest | req |
ServiceStack.Auth.IAuthRepository | authRepo |
HasAllRolesAsync(IAuthSession, ICollection<String>, IAuthRepositoryAsync, IRequest, CancellationToken)
View Source
Declaration
public static Task<bool> HasAllRolesAsync(this IAuthSession session, ICollection<string> requiredRoles, IAuthRepositoryAsync authRepo, IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Collections.Generic.ICollection<System.String> | requiredRoles |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
ServiceStack.Web.IRequest | req |
System.Threading.CancellationToken | token |
HasAnyRolesAsync(IAuthSession, ICollection<String>, IAuthRepositoryAsync, IRequest, CancellationToken)
View Source
Declaration
public static Task<bool> HasAnyRolesAsync(this IAuthSession session, ICollection<string> roles, IAuthRepositoryAsync authRepo, IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Collections.Generic.ICollection<System.String> | roles |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
ServiceStack.Web.IRequest | req |
System.Threading.CancellationToken | token |
HasAllPermissionsAsync(IAuthSession, ICollection<String>, IAuthRepositoryAsync, IRequest, CancellationToken)
View Source
Declaration
public static Task<bool> HasAllPermissionsAsync(this IAuthSession session, ICollection<string> requiredPermissions, IAuthRepositoryAsync authRepo, IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Collections.Generic.ICollection<System.String> | requiredPermissions |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
ServiceStack.Web.IRequest | req |
System.Threading.CancellationToken | token |
HasAnyPermissionsAsync(IAuthSession, ICollection<String>, IAuthRepositoryAsync, IRequest, CancellationToken)
View Source
Declaration
public static Task<bool> HasAnyPermissionsAsync(this IAuthSession session, ICollection<string> permissions, IAuthRepositoryAsync authRepo, IRequest req, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
System.Collections.Generic.ICollection<System.String> | permissions |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
ServiceStack.Web.IRequest | req |
System.Threading.CancellationToken | token |