@@ -443,7 +452,9 @@ else
private string _pkce;
private string _redirecturl;
private string _reviewclaims;
+ private string _externalloginurl;
private string _identifierclaimtype;
+ private string _nameclaimtype;
private string _emailclaimtype;
private string _roleclaimtype;
private string _profileclaimtypes;
@@ -505,7 +516,9 @@ else
_pkce = SettingService.GetSetting(settings, "ExternalLogin:PKCE", "false");
_redirecturl = PageState.Uri.Scheme + "://" + PageState.Alias.Name + "/signin-" + _providertype;
_reviewclaims = SettingService.GetSetting(settings, "ExternalLogin:ReviewClaims", "false");
+ _externalloginurl = Utilities.TenantUrl(PageState.Alias, "/pages/external");
_identifierclaimtype = SettingService.GetSetting(settings, "ExternalLogin:IdentifierClaimType", "sub");
+ _nameclaimtype = SettingService.GetSetting(settings, "ExternalLogin:NameClaimType", "name");
_emailclaimtype = SettingService.GetSetting(settings, "ExternalLogin:EmailClaimType", "email");
_roleclaimtype = SettingService.GetSetting(settings, "ExternalLogin:RoleClaimType", "");
_profileclaimtypes = SettingService.GetSetting(settings, "ExternalLogin:ProfileClaimTypes", "");
@@ -598,7 +611,8 @@ else
settings = SettingService.SetSetting(settings, "ExternalLogin:PKCE", _pkce, true);
settings = SettingService.SetSetting(settings, "ExternalLogin:ReviewClaims", _reviewclaims, true);
settings = SettingService.SetSetting(settings, "ExternalLogin:IdentifierClaimType", _identifierclaimtype, true);
- settings = SettingService.SetSetting(settings, "ExternalLogin:EmailClaimType", _emailclaimtype, true);
+ settings = SettingService.SetSetting(settings, "ExternalLogin:NameClaimType", _nameclaimtype, true);
+ settings = SettingService.SetSetting(settings, "ExternalLogin:EmailClaimType", _emailclaimtype, true);
settings = SettingService.SetSetting(settings, "ExternalLogin:RoleClaimType", _roleclaimtype, true);
settings = SettingService.SetSetting(settings, "ExternalLogin:ProfileClaimTypes", _profileclaimtypes, true);
settings = SettingService.SetSetting(settings, "ExternalLogin:DomainFilter", _domainfilter, true);
diff --git a/Oqtane.Client/Resources/Modules/Admin/Login/Index.resx b/Oqtane.Client/Resources/Modules/Admin/Login/Index.resx
index 6c8ffd2a..3467911a 100644
--- a/Oqtane.Client/Resources/Modules/Admin/Login/Index.resx
+++ b/Oqtane.Client/Resources/Modules/Admin/Login/Index.resx
@@ -204,8 +204,8 @@
Multiple User Accounts Already Exist With The Email Address Of Your External Login. Please Contact Your Administrator For Further Instructions.
-
- The External Login Provider Did Not Provide A Valid Email Address For Your Account. Please Contact Your Administrator For Further Instructions.
+
+ The External Login Provider Did Not Provide All Of The Required Information. Please Contact Your Administrator For Further Instructions.An Error Occurred Verifying Your External Login. Please Contact Your Administrator For Further Instructions.
diff --git a/Oqtane.Client/Resources/Modules/Admin/UserProfile/Index.resx b/Oqtane.Client/Resources/Modules/Admin/UserProfile/Index.resx
index 8bcffb8c..7e6b222d 100644
--- a/Oqtane.Client/Resources/Modules/Admin/UserProfile/Index.resx
+++ b/Oqtane.Client/Resources/Modules/Admin/UserProfile/Index.resx
@@ -147,6 +147,9 @@
Current User Is Not Logged In
+
+ You Must Provide An Email Address For Your User Account
+
Error Loading User Profile
diff --git a/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx b/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx
index 0b36da94..6baae9c1 100644
--- a/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx
+++ b/Oqtane.Client/Resources/Modules/Admin/Users/Index.resx
@@ -247,7 +247,7 @@
Domain Filter:
- The name of the email address claim provided by the identity provider
+ Optionally specify the type name of the email address claim provided by the identity provider. The typical value is 'email'.Email Claim:
@@ -274,7 +274,7 @@
Use PKCE?
- The external login provider name which will be displayed on the login page
+ Specify a friendly name for the external login provider which will be displayed on the Login pageProvider Name:
@@ -373,7 +373,7 @@
Last Login
- The name of the unique user identifier claim provided by the identity provider
+ Specify the type name of the unique user identifier claim provided by the identity provider. The default value is 'sub'.Identifier Claim:
@@ -385,13 +385,13 @@
Parameters:
- Optionally provide the name of the role claim provided by the identity provider. These roles will be used in addition to any internal user roles assigned within the site.
+ Optionally provide the type name of the role claim provided by the identity provider. These roles will be used in addition to any internal user roles assigned within the site.Role Claim:
- Optionally provide a comma delimited list of user profile claims provided by the identity provider, as well as mappings to your user profile definition. For example if the identity provider includes a 'given_name' claim and you have a 'FirstName' user profile definition you should specify 'given_name:FirstName'.
+ Optionally provide a comma delimited list of user profile claim type names provided by the identity provider, as well as mappings to your user profile definition. For example if the identity provider includes a 'given_name' claim and you have a 'FirstName' user profile definition you should specify 'given_name:FirstName'.User Profile Claims:
@@ -460,6 +460,12 @@
Review Claims?
- This option should only be used for testing. It allows the full list of Claims returned by the Provider to be recorded in the Event Log. Please note that external login is restricted when this option is enabled.
+ This option will record the full list of Claims returned by the Provider in the Event Log. It should only be used for testing purposes. External Login will be restricted when this option is enabled.
+
+
+ Optionally specify the type name of the user's name claim provided by the identity provider. The typical value is 'name'.
+
+
+ Name Claim:
\ No newline at end of file
diff --git a/Oqtane.Client/Resources/SharedResources.resx b/Oqtane.Client/Resources/SharedResources.resx
index d5355423..b00c7ce9 100644
--- a/Oqtane.Client/Resources/SharedResources.resx
+++ b/Oqtane.Client/Resources/SharedResources.resx
@@ -435,4 +435,7 @@
Uninstall
+
+ Test
+
\ No newline at end of file
diff --git a/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs b/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs
index b3de5229..3279a94e 100644
--- a/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs
+++ b/Oqtane.Client/Themes/Controls/Theme/LoginBase.cs
@@ -26,8 +26,7 @@ namespace Oqtane.Themes.Controls
var allowexternallogin = (SettingService.GetSetting(PageState.Site.Settings, "ExternalLogin:ProviderType", "") != "") ? true : false;
var allowsitelogin = bool.Parse(SettingService.GetSetting(PageState.Site.Settings, "LoginOptions:AllowSiteLogin", "true"));
- Route route = new Route(PageState.Uri.AbsoluteUri, PageState.Alias.Path);
- var returnurl = WebUtility.UrlEncode(route.PathAndQuery);
+ var returnurl = WebUtility.UrlEncode(PageState.Route.PathAndQuery);
if (allowexternallogin && !allowsitelogin)
{
@@ -39,7 +38,6 @@ namespace Oqtane.Themes.Controls
// local login
NavigationManager.NavigateTo(NavigateUrl("login", "?returnurl=" + returnurl));
}
-
}
protected async Task LogoutUser()
diff --git a/Oqtane.Client/Themes/Controls/Theme/UserProfile.razor b/Oqtane.Client/Themes/Controls/Theme/UserProfile.razor
index 36a5e0c1..850e28c3 100644
--- a/Oqtane.Client/Themes/Controls/Theme/UserProfile.razor
+++ b/Oqtane.Client/Themes/Controls/Theme/UserProfile.razor
@@ -1,4 +1,5 @@
@namespace Oqtane.Themes.Controls
+@using System.Net
@inherits ThemeControlBase
@inject IStringLocalizer Localizer
@@ -26,14 +27,21 @@
[Parameter]
public bool ShowRegister { get; set; }
+ private string _returnurl = "";
+
+ protected override void OnParametersSet()
+ {
+ _returnurl = WebUtility.UrlEncode(PageState.Route.PathAndQuery);
+ }
+
private void RegisterUser()
{
- NavigationManager.NavigateTo(NavigateUrl("register"));
+ NavigationManager.NavigateTo(NavigateUrl("register", "returnurl=" + _returnurl));
}
private void UpdateProfile()
{
- NavigationManager.NavigateTo(NavigateUrl("profile"));
+ NavigationManager.NavigateTo(NavigateUrl("profile", "returnurl=" + _returnurl));
}
}
diff --git a/Oqtane.Client/UI/ThemeBuilder.razor b/Oqtane.Client/UI/ThemeBuilder.razor
index 920e362e..f906494b 100644
--- a/Oqtane.Client/UI/ThemeBuilder.razor
+++ b/Oqtane.Client/UI/ThemeBuilder.razor
@@ -1,4 +1,5 @@
@namespace Oqtane.UI
+@using System.Net
@inject IJSRuntime JSRuntime
@inject NavigationManager NavigationManager
@inject SiteState SiteState
@@ -87,6 +88,13 @@
protected override async Task OnAfterRenderAsync(bool firstRender)
{
+ // force user to provide email address (email may be missing if using external login)
+ if (PageState.User != null && string.IsNullOrEmpty(PageState.User.Email) && PageState.Route.PagePath != "profile")
+ {
+ NavigationManager.NavigateTo(Utilities.NavigateUrl(PageState.Alias.Path, "profile", "returnurl=" + WebUtility.UrlEncode(PageState.Route.PathAndQuery)));
+ return;
+ }
+
if (!firstRender)
{
if (!string.IsNullOrEmpty(PageState.Page.HeadContent) && PageState.Page.HeadContent.Contains("