Merge branch 'master' of https://github.com/edgeofsanity76/Budgeteer
This commit is contained in:
commit
3b7e4e6ec5
5 files changed
+16
-15
No files matched your search
+5
-13
@@ -58,21 +58,13 @@ if (!string.IsNullOrEmpty(microsoftSection["ClientId"]) && !string.IsNullOrEmpty
|
||||
});
|
||||
}
|
||||
|
||||
var githubSection = builder.Configuration.GetSection("Authentication:GitHub");
|
||||
if (!string.IsNullOrEmpty(githubSection["ClientId"]) && !string.IsNullOrEmpty(githubSection["ClientSecret"]))
|
||||
var facebookSection = builder.Configuration.GetSection("Authentication:Facebook");
|
||||
if (!string.IsNullOrEmpty(facebookSection["ClientId"]) && !string.IsNullOrEmpty(facebookSection["ClientSecret"]))
|
||||
{
|
||||
authBuilder.AddOAuth("GitHub", "GitHub", options =>
|
||||
authBuilder.AddFacebook(options =>
|
||||
{
|
||||
options.ClientId = githubSection["ClientId"]!;
|
||||
options.ClientSecret = githubSection["ClientSecret"]!;
|
||||
options.AuthorizationEndpoint = "https://github.com/login/oauth/authorize";
|
||||
options.TokenEndpoint = "https://github.com/login/oauth/access_token";
|
||||
options.UserInformationEndpoint = "https://api.github.com/user";
|
||||
options.CallbackPath = "/signin-github";
|
||||
options.Scope.Add("user:email");
|
||||
options.ClaimActions.MapJsonKey(System.Security.Claims.ClaimTypes.NameIdentifier, "id");
|
||||
options.ClaimActions.MapJsonKey(System.Security.Claims.ClaimTypes.Name, "login");
|
||||
options.ClaimActions.MapJsonKey(System.Security.Claims.ClaimTypes.Email, "email");
|
||||
options.ClientId = facebookSection["ClientId"]!;
|
||||
options.ClientSecret = facebookSection["ClientSecret"]!;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user