C# 클래스 Box.V2.Auth.AuthRepository

Default auth repository implementation that will manage the life cycle of the authentication tokens. This class can be extended to provide your own token management implementation by overriding the virtual methods
상속: IAuthRepository
파일 보기 프로젝트 열기: box/box-windows-sdk-v2 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_config IBoxConfig
_converter IBoxConverter
_service IBoxService

공개 메소드들

메소드 설명
AuthRepository ( IBoxConfig boxConfig, IBoxService boxService, IBoxConverter converter ) : Box.V2.Config

Instantiates a new AuthRepository.

AuthRepository ( IBoxConfig boxConfig, IBoxService boxService, IBoxConverter converter, OAuthSession session ) : Box.V2.Config

Instantiates a new AuthRepository

AuthenticateAsync ( string authCode ) : Task

Authenticates the session by exchanging the provided auth code for a Access/Refresh token pair

LogoutAsync ( ) : Task

Logs the current session out by invalidating the current Access/Refresh tokens

RefreshAccessTokenAsync ( string accessToken ) : Task

Refreshes the session by exchanging the access token for a new Access/Refresh token pair. In general, this method should not need to be called explicitly, as an automatic refresh is invoked when the SDK detects that the tokens have expired.

보호된 메소드들

메소드 설명
ExchangeAuthCode ( string authCode ) : Task

Performs the authentication request using the provided auth code

ExchangeRefreshToken ( string refreshToken ) : Task

Performs the refresh request using the provided refresh token

InvalidateTokens ( string accessToken ) : Task

Performs the revoke request using the provided access token. This will invalidate both the access and refresh tokens

OnSessionAuthenticated ( OAuthSession session ) : void

Allows sub classes to invoke the SessionAuthenticated event.

OnSessionInvalidated ( ) : void

Allows sub classes to invoke the SessionInvalidated event

메소드 상세

AuthRepository() 공개 메소드

Instantiates a new AuthRepository.
public AuthRepository ( IBoxConfig boxConfig, IBoxService boxService, IBoxConverter converter ) : Box.V2.Config
boxConfig IBoxConfig The Box configuration that should be used.
boxService IBoxService The Box service that will be used to make the requests.
converter IBoxConverter How requests/responses will be serialized/deserialized respectively.
리턴 Box.V2.Config

AuthRepository() 공개 메소드

Instantiates a new AuthRepository
public AuthRepository ( IBoxConfig boxConfig, IBoxService boxService, IBoxConverter converter, OAuthSession session ) : Box.V2.Config
boxConfig IBoxConfig The Box configuration that should be used
boxService IBoxService The Box service that will be used to make the requests
converter IBoxConverter How requests/responses will be serialized/deserialized respectively
session OAuthSession The current authenticated session
리턴 Box.V2.Config

AuthenticateAsync() 공개 메소드

Authenticates the session by exchanging the provided auth code for a Access/Refresh token pair
public AuthenticateAsync ( string authCode ) : Task
authCode string Authorization Code. The authorization code is only valid for 30 seconds.
리턴 Task

ExchangeAuthCode() 보호된 메소드

Performs the authentication request using the provided auth code
protected ExchangeAuthCode ( string authCode ) : Task
authCode string Authorization Code. The authorization code is only valid for 30 seconds.
리턴 Task

ExchangeRefreshToken() 보호된 메소드

Performs the refresh request using the provided refresh token
protected ExchangeRefreshToken ( string refreshToken ) : Task
refreshToken string Refresh token used to exchange for a new access token. Each refresh_token is valid for one use in 60 days. Every time you get a new access_token by using a refresh_token, we reset your timer for the 60 day period and hand you a new refresh_token
리턴 Task

InvalidateTokens() 보호된 메소드

Performs the revoke request using the provided access token. This will invalidate both the access and refresh tokens
protected InvalidateTokens ( string accessToken ) : Task
accessToken string The access token to invalidate
리턴 Task

LogoutAsync() 공개 메소드

Logs the current session out by invalidating the current Access/Refresh tokens
public LogoutAsync ( ) : Task
리턴 Task

OnSessionAuthenticated() 보호된 메소드

Allows sub classes to invoke the SessionAuthenticated event.
protected OnSessionAuthenticated ( OAuthSession session ) : void
session OAuthSession Authenticated session.
리턴 void

OnSessionInvalidated() 보호된 메소드

Allows sub classes to invoke the SessionInvalidated event
protected OnSessionInvalidated ( ) : void
리턴 void

RefreshAccessTokenAsync() 공개 메소드

Refreshes the session by exchanging the access token for a new Access/Refresh token pair. In general, this method should not need to be called explicitly, as an automatic refresh is invoked when the SDK detects that the tokens have expired.
public RefreshAccessTokenAsync ( string accessToken ) : Task
accessToken string The access token to refresh.
리턴 Task

프로퍼티 상세

_config 보호되어 있는 프로퍼티

protected IBoxConfig _config
리턴 IBoxConfig

_converter 보호되어 있는 프로퍼티

protected IBoxConverter _converter
리턴 IBoxConverter

_service 보호되어 있는 프로퍼티

protected IBoxService _service
리턴 IBoxService