C# Класс WebChat.Services.UserSessionUtilities.UserSessionManager

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
GetCurrentBearerAuthrorizationToken ( ) : string
GetCurrentUserId ( ) : string

Описание методов

CreateUserSession() публичный Метод

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
Результат void

DeleteExpiredSessions() публичный Метод

public DeleteExpiredSessions ( ) : void
Результат void

InvalidateUserSession() публичный Метод

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
Результат void

ReValidateSession() публичный Метод

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
Результат bool

UserSessionManager() публичный Метод

public UserSessionManager ( IOwinContext context ) : System
context IOwinContext
Результат System

UserSessionManager() публичный Метод

public UserSessionManager ( IWebChatData data, IOwinContext context ) : System
data IWebChatData
context IOwinContext
Результат System