C# 클래스 WebChat.Services.UserSessionUtilities.UserSessionManager

파일 보기 프로젝트 열기: SoftUniTeamWork/WebServicesAndCloudTeamProject 1 사용 예제들

공개 메소드들

메소드 설명
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