Skip to main content

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​
TypeName
System.Stringrole
ServiceStack.Auth.IAuthRepositoryauthRepo

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​
TypeName
System.Stringrole
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Threading.CancellationTokentoken

HasPermission(String, IAuthRepository)​

View Source​
Declaration
bool HasPermission(string permission, IAuthRepository authRepo)
Returns​

System.Boolean

Parameters​
TypeName
System.Stringpermission
ServiceStack.Auth.IAuthRepositoryauthRepo

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​
TypeName
System.Stringpermission
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Threading.CancellationTokentoken

GetRoles(IAuthRepository)​

View Source​
Declaration
ICollection<string> GetRoles(IAuthRepository authRepo)
Returns​

System.Collections.Generic.ICollection<System.String>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo

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​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Threading.CancellationTokentoken

GetPermissions(IAuthRepository)​

View Source​
Declaration
ICollection<string> GetPermissions(IAuthRepository authRepo)
Returns​

System.Collections.Generic.ICollection<System.String>

Parameters​
TypeName
ServiceStack.Auth.IAuthRepositoryauthRepo

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​
TypeName
ServiceStack.Auth.IAuthRepositoryAsyncauthRepo
System.Threading.CancellationTokentoken

IsAuthorized(String)​

View Source​
Declaration
bool IsAuthorized(string provider)
Returns​

System.Boolean

Parameters​
TypeName
System.Stringprovider

OnCreated(IRequest)​

Fired when a new Session is created

View Source​
Declaration
void OnCreated(IRequest httpReq)
Parameters​
TypeName
ServiceStack.Web.IRequesthttpReq

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​
TypeName
ServiceStack.Web.IRequesthttpReq
ServiceStack.Auth.IAuthSessionsession
ServiceStack.IServiceBaseservice

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​
TypeName
ServiceStack.IServiceBaseauthService
ServiceStack.Auth.IAuthSessionsession
ServiceStack.Auth.IAuthTokenstokens
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​
TypeName
ServiceStack.IServiceBaseauthService