using System.Security.Cryptography.X509Certificates;
namespace MTSC.OAuth2.Models
{
public sealed class AuthorizationOptions
{
public enum Authentication
{
ClientSecret,
ClientCertificate
}
///
/// Uri of the openid configuration for your OAuth provider.
///
///
/// Azure: "https://login.microsoftonline.com/common/.well-known/openid-configuration".
/// Tenant Azure: "https://login.microsoftonline.com/[TENANT]/.well-known/openid-configuration".
/// Google: "https://accounts.google.com/.well-known/openid-configuration".
/// Facebook: "https://www.facebook.com/.well-known/openid-configuration/"
///
public string OpenIdConfigurationUri { get; set; }
///
/// OAuth uri for the OAuth provider.
///
///
/// Azure: "https://login.microsoftonline.com/common/oauth2/v2.0".
/// Azure Tenant: "https://login.microsoftonline.com/{tenant}/oauth2/v2.0".
/// Google: "https://accounts.google.com/o/oauth2/v2/auth".
/// Facebook: "https://graph.facebook.com/oauth"
///
public string OAuthUri { get; set; }
///
/// The endpoint for the access token. Most providers use /token but some providers use /access_token or other endpoints.
/// If your provider uses a different endpoint than /token, override this property with the correct endpoint.
///
public string AuthTokenEndpoint { get; set; } = "token";
///
/// ClientID of your Application, as it is registered on your OAuth provider.
///
public string ClientId { get; set; }
///
/// Certificate that is whitelisted as your Application on your OAuth provider.
///
public X509Certificate2 ClientCertificate { get; set; }
///
/// Value provided by your OAuth provider to authenticate your service as your Application.
///
public string ClientSecret { get; set; }
///
/// URI to redirect the request once authorization succeeds. This URI needs to be whitelisted with your
/// OAuth provider.
///
public string RedirectUri { get; set; }
///
/// Scopes of your authorization request. Example "User.Read" to read the user information.
///
public string Scopes { get; set; }
///
/// Specify what to use for authentication.
/// When using , the authorization flow will use the to authenticate with the OAuth provider.
/// When using , the authorization flow will use the to authenticate with the OAuth provider.
///
public Authentication AuthenticationMode { get; set; }
}
}