Skip to content

Update Facebook API to 4.0 #14798

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

Merged
merged 1 commit into from
Oct 17, 2019
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public static class FacebookDefaults
public static readonly string DisplayName = "Facebook";

// https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow#login
public static readonly string AuthorizationEndpoint = "https://www.facebook.com/v3.3/dialog/oauth";
public static readonly string AuthorizationEndpoint = "https://www.facebook.com/v4.0/dialog/oauth";

public static readonly string TokenEndpoint = "https://graph.facebook.com/v3.3/oauth/access_token";
public static readonly string TokenEndpoint = "https://graph.facebook.com/v4.0/oauth/access_token";

public static readonly string UserInformationEndpoint = "https://graph.facebook.com/v3.3/me";
public static readonly string UserInformationEndpoint = "https://graph.facebook.com/v4.0/me";
}
}
6 changes: 3 additions & 3 deletions src/Security/Authentication/test/FacebookTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public async Task NestedMapWillNotAffectRedirect()
var transaction = await server.SendAsync("http://example.com/base/login");
Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode);
var location = transaction.Response.Headers.Location.AbsoluteUri;
Assert.Contains("https://www.facebook.com/v3.3/dialog/oauth", location);
Assert.Contains("https://www.facebook.com/v4.0/dialog/oauth", location);
Assert.Contains("response_type=code", location);
Assert.Contains("client_id=", location);
Assert.Contains("redirect_uri=" + UrlEncoder.Default.Encode("http://example.com/base/signin-facebook"), location);
Expand Down Expand Up @@ -257,7 +257,7 @@ public async Task MapWillNotAffectRedirect()
var transaction = await server.SendAsync("http://example.com/login");
Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode);
var location = transaction.Response.Headers.Location.AbsoluteUri;
Assert.Contains("https://www.facebook.com/v3.3/dialog/oauth", location);
Assert.Contains("https://www.facebook.com/v4.0/dialog/oauth", location);
Assert.Contains("response_type=code", location);
Assert.Contains("client_id=", location);
Assert.Contains("redirect_uri=" + UrlEncoder.Default.Encode("http://example.com/signin-facebook"), location);
Expand Down Expand Up @@ -291,7 +291,7 @@ public async Task ChallengeWillTriggerRedirection()
var transaction = await server.SendAsync("http://example.com/challenge");
Assert.Equal(HttpStatusCode.Redirect, transaction.Response.StatusCode);
var location = transaction.Response.Headers.Location.AbsoluteUri;
Assert.Contains("https://www.facebook.com/v3.3/dialog/oauth", location);
Assert.Contains("https://www.facebook.com/v4.0/dialog/oauth", location);
Assert.Contains("response_type=code", location);
Assert.Contains("client_id=", location);
Assert.Contains("redirect_uri=", location);
Expand Down