From 3d8886a06461a4d3282c60db6253059cde6e5278 Mon Sep 17 00:00:00 2001 From: Chris R Date: Wed, 2 Dec 2015 11:04:44 -0800 Subject: [PATCH] #566 Update Google token endpoint. --- .../GoogleDefaults.cs | 2 +- .../Google/GoogleMiddlewareTests.cs | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.AspNet.Authentication.Google/GoogleDefaults.cs b/src/Microsoft.AspNet.Authentication.Google/GoogleDefaults.cs index 28fa46bc57..ebd05602ab 100644 --- a/src/Microsoft.AspNet.Authentication.Google/GoogleDefaults.cs +++ b/src/Microsoft.AspNet.Authentication.Google/GoogleDefaults.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Authentication.Google public static readonly string AuthorizationEndpoint = "https://accounts.google.com/o/oauth2/auth"; - public static readonly string TokenEndpoint = "https://accounts.google.com/o/oauth2/token"; + public static readonly string TokenEndpoint = "https://www.googleapis.com/oauth2/v3/token"; public static readonly string UserInformationEndpoint = "https://www.googleapis.com/plus/v1/people/me"; } diff --git a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs index 5914722c5d..2e3336e057 100644 --- a/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs +++ b/test/Microsoft.AspNet.Authentication.Test/Google/GoogleMiddlewareTests.cs @@ -300,7 +300,7 @@ namespace Microsoft.AspNet.Authentication.Google { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://accounts.google.com/o/oauth2/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") { return ReturnJsonResponse(new { @@ -332,7 +332,7 @@ namespace Microsoft.AspNet.Authentication.Google }); } - return null; + throw new NotImplementedException(req.RequestUri.AbsoluteUri); } }; }); @@ -489,7 +489,7 @@ namespace Microsoft.AspNet.Authentication.Google { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://accounts.google.com/o/oauth2/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") { return ReturnJsonResponse(new { @@ -522,7 +522,7 @@ namespace Microsoft.AspNet.Authentication.Google }); } - return null; + throw new NotImplementedException(req.RequestUri.AbsoluteUri); } }; options.Events = new OAuthEvents @@ -569,7 +569,7 @@ namespace Microsoft.AspNet.Authentication.Google { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://accounts.google.com/o/oauth2/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") { return ReturnJsonResponse(new { @@ -602,7 +602,7 @@ namespace Microsoft.AspNet.Authentication.Google }); } - return null; + throw new NotImplementedException(req.RequestUri.AbsoluteUri); } }; options.Events = new OAuthEvents @@ -659,7 +659,7 @@ namespace Microsoft.AspNet.Authentication.Google { Sender = req => { - if (req.RequestUri.AbsoluteUri == "https://accounts.google.com/o/oauth2/token") + if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v3/token") { return ReturnJsonResponse(new { @@ -692,7 +692,7 @@ namespace Microsoft.AspNet.Authentication.Google }); } - return null; + throw new NotImplementedException(req.RequestUri.AbsoluteUri); } }; });