C# 클래스 Tailspin.Surveys.Web.Security.SurveysTokenService

This service helps with the acquisition of access tokens from Azure Active Directory.
상속: ISurveysTokenService
파일 보기 프로젝트 열기: Azure-Samples/guidance-identity-management-for-multitenant-apps

공개 메소드들

메소드 설명
ClearCacheAsync ( ClaimsPrincipal claimsPrincipal ) : System.Threading.Tasks.Task

This method clears the user's Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache.

GetTokenForWebApiAsync ( ClaimsPrincipal user ) : Task

This method retrieves the access token for the WebAPI resource that has previously been retrieved and cached. This method will fail if an access token for the WebAPI resource has not been retrieved and cached. You can use the RequestAccessTokenAsync method to retrieve and cache access tokens.

RequestTokenAsync ( ClaimsPrincipal claimsPrincipal, string authorizationCode, string redirectUri, string resource ) : Task

This method acquires an access token using an authorization code and ADAL. The access token is then cached in a TokenCache to be used later (by calls to GetTokenForWebApiAsync).

SurveysTokenService ( IOptions options, ITokenCacheService tokenCacheService, ICredentialService credentialService, ILogger logger ) : System

Initializes a new instance of Tailspin.Surveys.Web.Security.SurveysTokenService.

비공개 메소드들

메소드 설명
CreateAuthenticationContext ( ClaimsPrincipal claimsPrincipal ) : Task
GetAccessTokenForResourceAsync ( string resource, ClaimsPrincipal user ) : Task

메소드 상세

ClearCacheAsync() 공개 메소드

This method clears the user's Microsoft.IdentityModel.Clients.ActiveDirectory.TokenCache.
public ClearCacheAsync ( ClaimsPrincipal claimsPrincipal ) : System.Threading.Tasks.Task
claimsPrincipal System.Security.Claims.ClaimsPrincipal The for the user
리턴 System.Threading.Tasks.Task

GetTokenForWebApiAsync() 공개 메소드

This method retrieves the access token for the WebAPI resource that has previously been retrieved and cached. This method will fail if an access token for the WebAPI resource has not been retrieved and cached. You can use the RequestAccessTokenAsync method to retrieve and cache access tokens.
public GetTokenForWebApiAsync ( ClaimsPrincipal user ) : Task
user System.Security.Claims.ClaimsPrincipal The for the user to whom the access token belongs.
리턴 Task

RequestTokenAsync() 공개 메소드

This method acquires an access token using an authorization code and ADAL. The access token is then cached in a TokenCache to be used later (by calls to GetTokenForWebApiAsync).
public RequestTokenAsync ( ClaimsPrincipal claimsPrincipal, string authorizationCode, string redirectUri, string resource ) : Task
claimsPrincipal System.Security.Claims.ClaimsPrincipal A for the signed in user
authorizationCode string a string authorization code obtained when the user signed in
redirectUri string The Uri of the application requesting the access token
resource string The resouce identifier of the target resource
리턴 Task

SurveysTokenService() 공개 메소드

Initializes a new instance of Tailspin.Surveys.Web.Security.SurveysTokenService.
public SurveysTokenService ( IOptions options, ITokenCacheService tokenCacheService, ICredentialService credentialService, ILogger logger ) : System
options IOptions
tokenCacheService ITokenCacheService
credentialService ICredentialService
logger ILogger
리턴 System