Table of Contents

Class CloudFoundryOAuthHandler

Namespace
Steeltoe.Security.Authentication.CloudFoundry
Assembly
Steeltoe.Security.Authentication.CloudFoundryCore.dll
public class CloudFoundryOAuthHandler : OAuthHandler<CloudFoundryOAuthOptions>, IAuthenticationRequestHandler, IAuthenticationHandler
Inheritance
CloudFoundryOAuthHandler
Implements
Inherited Members

Constructors

CloudFoundryOAuthHandler(IOptionsMonitor<CloudFoundryOAuthOptions>, ILoggerFactory, UrlEncoder, ISystemClock)

public CloudFoundryOAuthHandler(IOptionsMonitor<CloudFoundryOAuthOptions> options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock)

Parameters

options IOptionsMonitor<CloudFoundryOAuthOptions>
logger ILoggerFactory
encoder UrlEncoder
clock ISystemClock

Methods

BuildChallengeUrl(AuthenticationProperties, string)

Constructs the OAuth challenge url.

protected override string BuildChallengeUrl(AuthenticationProperties properties, string redirectUri)

Parameters

properties AuthenticationProperties

The AuthenticationProperties.

redirectUri string

The url to redirect to once the challenge is completed.

Returns

string

The challenge url.

CreateTicketAsync(ClaimsIdentity, AuthenticationProperties, OAuthTokenResponse)

Creates an AuthenticationTicket from the specified tokens.

protected override Task<AuthenticationTicket> CreateTicketAsync(ClaimsIdentity identity, AuthenticationProperties properties, OAuthTokenResponse tokens)

Parameters

identity ClaimsIdentity

The ClaimsIdentity.

properties AuthenticationProperties

The AuthenticationProperties.

tokens OAuthTokenResponse

The OAuthTokenResponse.

Returns

Task<AuthenticationTicket>

The AuthenticationTicket.

ExchangeCodeAsync(OAuthCodeExchangeContext)

Exchanges the authorization code for a authorization token from the remote provider.

protected override Task<OAuthTokenResponse> ExchangeCodeAsync(OAuthCodeExchangeContext context)

Parameters

context OAuthCodeExchangeContext

The OAuthCodeExchangeContext.

Returns

Task<OAuthTokenResponse>

The response OAuthTokenResponse.

GetEncoded(string, string)

protected string GetEncoded(string user, string password)

Parameters

user string
password string

Returns

string

GetHttpClient()

protected virtual HttpClient GetHttpClient()

Returns

HttpClient

GetTokenInfoRequestMessage(OAuthTokenResponse)

protected virtual HttpRequestMessage GetTokenInfoRequestMessage(OAuthTokenResponse tokens)

Parameters

tokens OAuthTokenResponse

Returns

HttpRequestMessage

GetTokenInfoRequestParameters(OAuthTokenResponse)

protected virtual Dictionary<string, string> GetTokenInfoRequestParameters(OAuthTokenResponse tokens)

Parameters

tokens OAuthTokenResponse

Returns

Dictionary<string, string>