diff --git a/src/Microsoft.AspNetCore.Authentication.Google/GoogleDefaults.cs b/src/Microsoft.AspNetCore.Authentication.Google/GoogleDefaults.cs index 06fd12eb1..c17ff6b2a 100644 --- a/src/Microsoft.AspNetCore.Authentication.Google/GoogleDefaults.cs +++ b/src/Microsoft.AspNetCore.Authentication.Google/GoogleDefaults.cs @@ -9,7 +9,7 @@ public static class GoogleDefaults public static readonly string AuthorizationEndpoint = "https://accounts.google.com/o/oauth2/auth"; - public static readonly string TokenEndpoint = "https://www.googleapis.com/oauth2/v3/token"; + public static readonly string TokenEndpoint = "https://www.googleapis.com/oauth2/v4/token"; public static readonly string UserInformationEndpoint = "https://www.googleapis.com/plus/v1/people/me"; } diff --git a/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs index 31fb9e317..42cecf81b 100644 --- a/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.Authentication.Test/Google/GoogleMiddlewareTests.cs @@ -299,7 +299,7 @@ public async Task ReplyPathWillAuthenticateValidAuthorizeCodeAndState(string cla { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v4/token") { return ReturnJsonResponse(new { @@ -489,7 +489,7 @@ public async Task AuthenticatedEventCanGetRefreshToken() { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v4/token") { return ReturnJsonResponse(new { @@ -569,7 +569,7 @@ public async Task NullRedirectUriWillRedirectToSlash() { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v4/token") { return ReturnJsonResponse(new { @@ -659,7 +659,7 @@ public async Task ValidateAuthenticatedContext() { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v4/token") { return ReturnJsonResponse(new {