C# Class WebChat.Services.UserSessionUtilities.UserSessionManager

Afficher le fichier Open project: SoftUniTeamWork/WebServicesAndCloudTeamProject Class Usage Examples

Méthodes publiques

Méthode Description
CreateUserSession ( string username, string authToken ) : void

Extends the validity period of the current user's session in the database. This will configure the user's bearer authorization token to expire after certain period of time (e.g. 30 minutes, see UserSessionTimeout in Web.config)

DeleteExpiredSessions ( ) : void
InvalidateUserSession ( ) : void

Makes the current user session invalid (deletes the session token from the user sessions). The goal is to revoke any further access with the same authorization bearer token. Typically this method is called at "logout".

ReValidateSession ( ) : bool

Re-validates the user session. Usually called at each authorization request. If the session is not expired, extends it lifetime and returns true. If the session is expired or does not exist, return false.

UserSessionManager ( IOwinContext context ) : System
UserSessionManager ( IWebChatData data, IOwinContext context ) : System

Private Methods

Méthode Description
GetCurrentBearerAuthrorizationToken ( ) : string
GetCurrentUserId ( ) : string

Method Details

CreateUserSession() public méthode

Extends the validity period of the current user's session in the database. This will configure the user's bearer authorization token to expire after certain period of time (e.g. 30 minutes, see UserSessionTimeout in Web.config)
public CreateUserSession ( string username, string authToken ) : void
username string
authToken string
Résultat void

DeleteExpiredSessions() public méthode

public DeleteExpiredSessions ( ) : void
Résultat void

InvalidateUserSession() public méthode

Makes the current user session invalid (deletes the session token from the user sessions). The goal is to revoke any further access with the same authorization bearer token. Typically this method is called at "logout".
public InvalidateUserSession ( ) : void
Résultat void

ReValidateSession() public méthode

Re-validates the user session. Usually called at each authorization request. If the session is not expired, extends it lifetime and returns true. If the session is expired or does not exist, return false.
public ReValidateSession ( ) : bool
Résultat bool

UserSessionManager() public méthode

public UserSessionManager ( IOwinContext context ) : System
context IOwinContext
Résultat System

UserSessionManager() public méthode

public UserSessionManager ( IWebChatData data, IOwinContext context ) : System
data IWebChatData
context IOwinContext
Résultat System