IAuthSession
Assembly: ServiceStack.dll
View Source
Declaration
public interface IAuthSession
Properties
ReferrerUrl
View Source
Declaration
string ReferrerUrl { get; set; }
Id
View Source
Declaration
string Id { get; set; }
UserAuthId
View Source
Declaration
string UserAuthId { get; set; }
UserAuthName
View Source
Declaration
string UserAuthName { get; set; }
UserName
View Source
Declaration
string UserName { get; set; }
DisplayName
View Source
Declaration
string DisplayName { get; set; }
FirstName
View Source
Declaration
string FirstName { get; set; }
LastName
View Source
Declaration
string LastName { get; set; }
Email
View Source
Declaration
string Email { get; set; }
ProviderOAuthAccess
View Source
Declaration
List<IAuthTokens> ProviderOAuthAccess { get; set; }
CreatedAt
View Source
Declaration
DateTime CreatedAt { get; set; }
LastModified
View Source
Declaration
DateTime LastModified { get; set; }
Roles
View Source
Declaration
List<string> Roles { get; set; }
Permissions
View Source
Declaration
List<string> Permissions { get; set; }
IsAuthenticated
View Source
Declaration
bool IsAuthenticated { get; set; }
FromToken
View Source
Declaration
bool FromToken { get; set; }
AuthProvider
View Source
Declaration
string AuthProvider { get; set; }
ProfileUrl
View Source
Declaration
string ProfileUrl { get; set; }
Sequence
View Source
Declaration
string Sequence { get; set; }
Methods
HasRole(String, IAuthRepository)
View Source
Declaration
bool HasRole(string role, IAuthRepository authRepo)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | role |
ServiceStack.Auth.IAuthRepository | authRepo |
HasRoleAsync(String, IAuthRepositoryAsync, CancellationToken)
View Source
Declaration
Task<bool> HasRoleAsync(string role, IAuthRepositoryAsync authRepo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | role |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
System.Threading.CancellationToken | token |
HasPermission(String, IAuthRepository)
View Source
Declaration
bool HasPermission(string permission, IAuthRepository authRepo)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | permission |
ServiceStack.Auth.IAuthRepository | authRepo |
HasPermissionAsync(String, IAuthRepositoryAsync, CancellationToken)
View Source
Declaration
Task<bool> HasPermissionAsync(string permission, IAuthRepositoryAsync authRepo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
System.String | permission |
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
System.Threading.CancellationToken | token |
GetRoles(IAuthRepository)
View Source
Declaration
ICollection<string> GetRoles(IAuthRepository authRepo)
Returns
System.Collections.Generic.ICollection<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepository | authRepo |
GetRolesAsync(IAuthRepositoryAsync, CancellationToken)
View Source
Declaration
Task<ICollection<string>> GetRolesAsync(IAuthRepositoryAsync authRepo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<System.String>>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
System.Threading.CancellationToken | token |
GetPermissions(IAuthRepository)
View Source
Declaration
ICollection<string> GetPermissions(IAuthRepository authRepo)
Returns
System.Collections.Generic.ICollection<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepository | authRepo |
GetPermissionsAsync(IAuthRepositoryAsync, CancellationToken)
View Source
Declaration
Task<ICollection<string>> GetPermissionsAsync(IAuthRepositoryAsync authRepo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<System.String>>
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthRepositoryAsync | authRepo |
System.Threading.CancellationToken | token |
IsAuthorized(String)
View Source
Declaration
bool IsAuthorized(string provider)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | provider |
OnCreated(IRequest)
Fired when a new Session is created
View Source
Declaration
void OnCreated(IRequest httpReq)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
OnRegistered(IRequest, IAuthSession, IServiceBase)
Called when the user is registered or on the first OAuth login
View Source
Declaration
void OnRegistered(IRequest httpReq, IAuthSession session, IServiceBase service)
Parameters
Type | Name |
---|---|
ServiceStack.Web.IRequest | httpReq |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.IServiceBase | service |
OnAuthenticated(IServiceBase, IAuthSession, IAuthTokens, Dictionary<String, String>)
Called after the user has successfully authenticated
View Source
Declaration
void OnAuthenticated(IServiceBase authService, IAuthSession session, IAuthTokens tokens, Dictionary<string, string> authInfo)
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
OnLogout(IServiceBase)
Fired before the session is removed after the /auth/logout Service is called
View Source
Declaration
void OnLogout(IServiceBase authService)
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |