C# Класс Tailspin.Surveys.Web.Security.SurveysTokenService

This service helps with the acquisition of access tokens from Azure Active Directory.
Наследование: ISurveysTokenService
Показать файл Открыть проект

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

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