Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Facebook OAuth endpoints, tests #413

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Microsoft.Owin.Security.Facebook/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ internal static class Constants
public const string DefaultAuthenticationType = "Facebook";

// https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login
internal const string AuthorizationEndpoint = "https://www.facebook.com/v8.0/dialog/oauth";
internal const string TokenEndpoint = "https://graph.facebook.com/v8.0/oauth/access_token";
internal const string UserInformationEndpoint = "https://graph.facebook.com/v8.0/me";
internal const string AuthorizationEndpoint = "https://www.facebook.com/v10.0/dialog/oauth";
internal const string TokenEndpoint = "https://graph.facebook.com/v10.0/oauth/access_token";
internal const string UserInformationEndpoint = "https://graph.facebook.com/v10.0/me";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public async Task ChallengeWillTriggerRedirection()
var transaction = await SendAsync(server, "http://example.com/challenge");
transaction.Response.StatusCode.ShouldBe(HttpStatusCode.Redirect);
var location = transaction.Response.Headers.Location.AbsoluteUri;
location.ShouldContain("https://www.facebook.com/v2.8/dialog/oauth");
location.ShouldContain("https://www.facebook.com/v10.0/dialog/oauth");
location.ShouldContain("?response_type=code");
location.ShouldContain("&client_id=");
location.ShouldContain("&redirect_uri=");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public async Task ReplyPathWillAuthenticateValidAuthorizeCodeAndState()
{
Sender = async req =>
{
if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v4/token")
if (req.RequestUri.AbsoluteUri == "https://oauth2.googleapis.com/token")
{
return await ReturnJsonResponse(new
{
Expand Down Expand Up @@ -351,7 +351,7 @@ public async Task AuthenticatedEventCanGetRefreshToken()
{
Sender = async req =>
{
if (req.RequestUri.AbsoluteUri == "https://www.googleapis.com/oauth2/v4/token")
if (req.RequestUri.AbsoluteUri == "https://oauth2.googleapis.com/token")
{
return await ReturnJsonResponse(new
{
Expand Down