using System;
using System.Collections.Generic;
using System.Net.Http;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Owin.Security.Providers.Google.Provider;
namespace Owin.Security.Providers.Google
{
public class GoogleAuthenticationOptions : AuthenticationOptions
{
///
/// Gets or sets the a pinned certificate validator to use to validate the endpoints used
/// in back channel communications belonging to Google.
///
///
/// The pinned certificate validator.
///
///
/// If this property is null then the default certificate checks are performed,
/// validating the subject name and if the signing chain is a trusted party.
///
public ICertificateValidator BackchannelCertificateValidator { get; set; }
///
/// The HttpMessageHandler used to communicate with Google.
/// This cannot be set at the same time as BackchannelCertificateValidator unless the value
/// can be downcast to a WebRequestHandler.
///
public HttpMessageHandler BackchannelHttpHandler { get; set; }
///
/// Gets or sets timeout value in milliseconds for back channel communications with Google.
///
///
/// The back channel timeout in milliseconds.
///
public TimeSpan BackchannelTimeout { get; set; }
///
/// The request path within the application's base path where the user-agent will be returned.
/// The middleware will process this request when it arrives.
/// Default value is "/signin-google".
///
public PathString CallbackPath { get; set; }
///
/// Get or sets the text that the user can display on a sign in user interface.
///
public string Caption
{
get { return Description.Caption; }
set { Description.Caption = value; }
}
///
/// Gets or sets the Google supplied Client ID
///
public string ClientId { get; set; }
///
/// Gets or sets the Google supplied Client Secret
///
public string ClientSecret { get; set; }
///
/// Gets or sets the used in the authentication events
///
public IGoogleAuthenticationProvider Provider { get; set; }
///
/// Gets or sets whether to request offline access. If offline access is requested the will contain a Refresh Token.
///
public bool RequestOfflineAccess { get; set; }
///
/// A list of permissions to request.
///
public IList Scope { get; private set; }
///
/// Gets or sets the name of another authentication middleware which will be responsible for actually issuing a user
/// .
///
public string SignInAsAuthenticationType { get; set; }
///
/// Gets or sets the type used to secure data handled by the middleware.
///
public ISecureDataFormat StateDataFormat { get; set; }
///
/// Initializes a new
///
public GoogleAuthenticationOptions()
: base("Google")
{
Caption = Constants.DefaultAuthenticationType;
CallbackPath = new PathString("/signin-google");
AuthenticationMode = AuthenticationMode.Passive;
Scope = new List
{
"openid",
"profile",
"email"
};
BackchannelTimeout = TimeSpan.FromSeconds(60);
}
}
}