Skip to content

Commit

Permalink
Merge pull request #4744 from sbwalker/dev
Browse files Browse the repository at this point in the history
add additional external login providers
  • Loading branch information
sbwalker authored Oct 16, 2024
2 parents 4c5a07e + 51d244f commit 5e95671
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Oqtane.Client/Modules/Admin/Users/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ else

private void LoadExternalLoginSettings(Dictionary<string, string> settings)
{
_provider = SettingService.GetSetting(settings, "ExternalLogin:Provider", "Custom");
_provider = SettingService.GetSetting(settings, "ExternalLogin:Provider", "<Custom>");
_providerurl = SettingService.GetSetting(settings, "ExternalLogin:ProviderUrl", "");
_providertype = SettingService.GetSetting(settings, "ExternalLogin:ProviderType", "");
_providername = SettingService.GetSetting(settings, "ExternalLogin:ProviderName", "");
Expand Down
37 changes: 35 additions & 2 deletions Oqtane.Shared/Shared/ExternalLoginProviders.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Oqtane.Models;

namespace Oqtane.Shared
Expand All @@ -13,9 +14,10 @@ public static List<ExternalLoginProvider> Providers
{
new ExternalLoginProvider
{
Name = "Custom",
Name = "<Custom>",
Settings = new Dictionary<string, string>()
},
// OIDC
new ExternalLoginProvider
{
Name = "Microsoft Entra",
Expand All @@ -30,6 +32,20 @@ public static List<ExternalLoginProvider> Providers
}
},
new ExternalLoginProvider
{
Name = "Auth0 (by Okta)",
Settings = new Dictionary<string, string>()
{
{ "ExternalLogin:ProviderUrl", "https://auth0.com/docs/get-started" },
{ "ExternalLogin:ProviderType", "oidc" },
{ "ExternalLogin:ProviderName", "Auth0" },
{ "ExternalLogin:Authority", "YOUR DOMAIN" },
{ "ExternalLogin:ClientId", "YOUR CLIENT ID" },
{ "ExternalLogin:ClientSecret", "YOUR CLIENT SECRET" }
}
},
// OAuth2
new ExternalLoginProvider
{
Name = "GitHub",
Settings = new Dictionary<string, string>()
Expand All @@ -46,10 +62,27 @@ public static List<ExternalLoginProvider> Providers
{ "ExternalLogin:IdentifierClaimType", "email" },
{ "ExternalLogin:DomainFilter", "!users.noreply.github.com" }
}
},
new ExternalLoginProvider
{
Name = "Facebook",
Settings = new Dictionary<string, string>()
{
{ "ExternalLogin:ProviderUrl", "https://developers.facebook.com/apps/" },
{ "ExternalLogin:ProviderType", "oauth2" },
{ "ExternalLogin:ProviderName", "Facebook" },
{ "ExternalLogin:AuthorizationUrl", "https://www.facebook.com/v18.0/dialog/oauth" },
{ "ExternalLogin:TokenUrl", "https://graph.facebook.com/v18.0/oauth/access_token" },
{ "ExternalLogin:UserInfoUrl", "https://graph.facebook.com/v18.0/me" },
{ "ExternalLogin:ClientId", "YOUR CLIENT ID" },
{ "ExternalLogin:ClientSecret", "YOUR CLIENT SECRET" },
{ "ExternalLogin:Scopes", "public_profile" },
{ "ExternalLogin:IdentifierClaimType", "id" }
}
}
};

return providers;
return providers.OrderBy(item => item.Name).ToList();
}
}
}
Expand Down

0 comments on commit 5e95671

Please sign in to comment.