From 1301c6c0d235a018b3776fb62d834d641d764a04 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Tue, 29 Jan 2019 11:43:50 +0000 Subject: [PATCH] Update GoogleAuthenticationOptions for Google Signin --- .../GoogleAuthenticationHandler.cs | 4 ---- .../GoogleAuthenticationOptions.cs | 23 +++++++------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/src/Owin.Security.Providers.Google/GoogleAuthenticationHandler.cs b/src/Owin.Security.Providers.Google/GoogleAuthenticationHandler.cs index 5ad96c8..70e95c0 100644 --- a/src/Owin.Security.Providers.Google/GoogleAuthenticationHandler.cs +++ b/src/Owin.Security.Providers.Google/GoogleAuthenticationHandler.cs @@ -194,10 +194,6 @@ namespace Owin.Security.Providers.Google if (Options.RequestOfflineAccess) authorizationEndpoint += "&access_type=offline"; - // Request the moment types - if (Options.MomentTypes.Count > 0) - authorizationEndpoint += $"&request_visible_actions={string.Join(" ", Options.MomentTypes)}"; - Response.Redirect(authorizationEndpoint); return Task.FromResult(null); diff --git a/src/Owin.Security.Providers.Google/GoogleAuthenticationOptions.cs b/src/Owin.Security.Providers.Google/GoogleAuthenticationOptions.cs index 0271228..f4bd555 100644 --- a/src/Owin.Security.Providers.Google/GoogleAuthenticationOptions.cs +++ b/src/Owin.Security.Providers.Google/GoogleAuthenticationOptions.cs @@ -11,7 +11,7 @@ namespace Owin.Security.Providers.Google { /// /// Gets or sets the a pinned certificate validator to use to validate the endpoints used - /// in back channel communications belong to Google+. + /// in back channel communications belonging to Google. /// /// /// The pinned certificate validator. @@ -23,14 +23,14 @@ namespace Owin.Security.Providers.Google public ICertificateValidator BackchannelCertificateValidator { get; set; } /// - /// The HttpMessageHandler used to communicate with Google+. + /// 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+. + /// Gets or sets timeout value in milliseconds for back channel communications with Google. /// /// /// The back channel timeout in milliseconds. @@ -40,7 +40,7 @@ namespace Owin.Security.Providers.Google /// /// 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-googleplus". + /// Default value is "/signin-google". /// public PathString CallbackPath { get; set; } @@ -63,12 +63,6 @@ namespace Owin.Security.Providers.Google /// public string ClientSecret { get; set; } - /// - /// The list of moment types which you application wants to write. During authentication this will be passed through via the request_visible_actions parameter. - /// For more information of the moment types you may request, see https://developers.google.com/+/api/moment-types/ - /// - public IList MomentTypes { get; private set; } - /// /// Gets or sets the used in the authentication events /// @@ -99,16 +93,15 @@ namespace Owin.Security.Providers.Google /// Initializes a new /// public GoogleAuthenticationOptions() - : base("GooglePlus") + : base("Google") { Caption = Constants.DefaultAuthenticationType; - CallbackPath = new PathString("/signin-googleplus"); + CallbackPath = new PathString("/signin-google"); AuthenticationMode = AuthenticationMode.Passive; - MomentTypes = new List(); Scope = new List { - "https://www.googleapis.com/auth/plus.login", - "https://www.googleapis.com/auth/plus.profile.emails.read" + "profile", + "email" }; BackchannelTimeout = TimeSpan.FromSeconds(60); }