diff --git a/docs/claim-transform.md b/docs/claim-transform.md index d559e8b9..3739d975 100644 --- a/docs/claim-transform.md +++ b/docs/claim-transform.md @@ -76,7 +76,8 @@ The API has a base URL and the functionality is divided into folders. Currently, If the base URL for the API is `https://somewhere.org/myclaimsstore` the URL for the `claims` folder will be `https://somewhere.org/myclaimsstore/claims`. -> FoxIDs cloud call the API from the IP address `57.128.60.142`. +> FoxIDs cloud calls your API from the IP address `57.128.60.142`. + *The outgoing IP address can be changed and more can be added over time.* #### Request The API call is secured with [HTTP Basic authentication scheme](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1) where FoxIDs sends the ID `external_claims` as the username and the configured secret as the password. diff --git a/docs/external-login.md b/docs/external-login.md index 43b7bb12..43e31305 100644 --- a/docs/external-login.md +++ b/docs/external-login.md @@ -30,7 +30,8 @@ The API has a base URL and the functionality is divided into folders. Currently, If the base URL for the API is `https://somewhere.org/mystore` the URL for the `authentication` folder will be `https://somewhere.org/mystore/authentication`. -> FoxIDs cloud call the API from the IP address `57.128.60.142`. +> FoxIDs cloud calls your API from the IP address `57.128.60.142`. + *The outgoing IP address can be changed and more can be added over time.* ### Request The API call is secured with [HTTP Basic authentication scheme](https://datatracker.ietf.org/doc/html/rfc6749#section-2.3.1) where FoxIDs sends the ID `external_login` as the username and the configured secret as the password. diff --git a/src/FoxIDs.Control/Controllers/Helpers/TDownPartyTestController.cs b/src/FoxIDs.Control/Controllers/Helpers/TDownPartyTestController.cs index 804e353a..8d50cadf 100644 --- a/src/FoxIDs.Control/Controllers/Helpers/TDownPartyTestController.cs +++ b/src/FoxIDs.Control/Controllers/Helpers/TDownPartyTestController.cs @@ -271,21 +271,20 @@ private string GetUpPartyDisplayName(UpPartyLink upParty) throw; } } - private string GetAuthority(string partyName, bool backendCall = false) + private string GetAuthority(string partyName) { var routeBinding = RouteBinding; - var useBackendCall = backendCall && !settings.FoxIDsBackendEndpoint.IsNullOrWhiteSpace(); - var useValidCustomDomain = !routeBinding.TrackName.Equals(Constants.Routes.MasterTrackName, StringComparison.OrdinalIgnoreCase) && routeBinding.UseCustomDomain; + var useValidCustomDomain = !routeBinding.TrackName.Equals(Constants.Routes.MasterTrackName, StringComparison.OrdinalIgnoreCase) && routeBinding.HasVerifiedCustomDomain; var urlItems = new List(); - if (useBackendCall || !useValidCustomDomain) + if (!useValidCustomDomain) { urlItems.Add(routeBinding.TenantName); } urlItems.Add(routeBinding.TrackName); urlItems.Add($"{partyName}(*)"); - return UrlCombine.Combine(useBackendCall ? settings.FoxIDsBackendEndpoint : (useValidCustomDomain ? $"{HttpContext.Request.Scheme}://{routeBinding.CustomDomain}" : settings.FoxIDsEndpoint), urlItems.ToArray()); + return UrlCombine.Combine(useValidCustomDomain ? $"{HttpContext.Request.Scheme}://{routeBinding.CustomDomain}" : settings.FoxIDsEndpoint, urlItems.ToArray()); } private async Task<(TokenResponse tokenResponse, ClaimsPrincipal idTokenPrincipal, ClaimsPrincipal accessTokenPrincipal)> AcquireTokensAsync(OidcDownParty mParty, string clientSecret, string nonce, string code) @@ -308,7 +307,7 @@ private string GetAuthority(string partyName, bool backendCall = false) CodeVerifier = mParty.CodeVerifier, }; - (var oidcDiscovery, var jsonWebKeySet) = await oidcDiscoveryReadLogic.GetOidcDiscoveryAndValidateAsync(GetAuthority(mParty.Name, backendCall: true)); + (var oidcDiscovery, var jsonWebKeySet) = await oidcDiscoveryReadLogic.GetOidcDiscoveryAndValidateAsync(GetAuthority(mParty.Name)); var requestDictionary = tokenRequest.ToDictionary().AddToDictionary(clientCredentials).AddToDictionary(codeVerifierSecret); diff --git a/src/FoxIDs.Control/FoxIDs.Control.csproj b/src/FoxIDs.Control/FoxIDs.Control.csproj index 3f82736e..ae0ce3fb 100644 --- a/src/FoxIDs.Control/FoxIDs.Control.csproj +++ b/src/FoxIDs.Control/FoxIDs.Control.csproj @@ -2,7 +2,7 @@ net8.0 - 1.12.4 + 1.12.7 FoxIDs Anders Revsgaard ITfoxtec diff --git a/src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj b/src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj index b083ce00..6e0e99c4 100644 --- a/src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj +++ b/src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj @@ -2,7 +2,7 @@ net8.0 - 1.12.4 + 1.12.7 FoxIDs.Client Anders Revsgaard ITfoxtec diff --git a/src/FoxIDs.ControlClient/Pages/Components/ELoginUpParty.cs b/src/FoxIDs.ControlClient/Pages/Components/ELoginUpParty.cs index 918c7634..0527e310 100644 --- a/src/FoxIDs.ControlClient/Pages/Components/ELoginUpParty.cs +++ b/src/FoxIDs.ControlClient/Pages/Components/ELoginUpParty.cs @@ -1,6 +1,5 @@ using FoxIDs.Client.Models.ViewModels; using System; -using System.Linq; using System.Threading.Tasks; using FoxIDs.Infrastructure; using FoxIDs.Client.Services; @@ -8,9 +7,9 @@ using ITfoxtec.Identity.BlazorWebAssembly.OpenidConnect; using FoxIDs.Client.Infrastructure.Security; using FoxIDs.Models.Api; -using System.Collections.Generic; using ITfoxtec.Identity; using System.Net.Http; +using System.Linq; namespace FoxIDs.Client.Pages.Components { @@ -62,7 +61,19 @@ private LoginUpPartyViewModel ToViewModel(LoginUpParty loginUpParty) { afterMap.CreateUser.ClaimTransforms = afterMap.CreateUser.ClaimTransforms.MapOAuthClaimTransforms(); } - }); + + if (afterMap.CreateUser?.Elements?.Count > 0) + { + foreach (var element in afterMap.CreateUser.Elements) + { + if (element.Type == DynamicElementTypes.EmailAndPassword) + { + element.IsStaticRequired = true; + element.Required = true; + } + } + } + }); } private async Task LoginUpPartyViewModelAfterInitAsync(GeneralLoginUpPartyViewModel loginParty, LoginUpPartyViewModel model) diff --git a/src/FoxIDs.ControlClient/Pages/Components/UpPartyBase.cs b/src/FoxIDs.ControlClient/Pages/Components/UpPartyBase.cs index 8bf05691..76a8d9c6 100644 --- a/src/FoxIDs.ControlClient/Pages/Components/UpPartyBase.cs +++ b/src/FoxIDs.ControlClient/Pages/Components/UpPartyBase.cs @@ -130,6 +130,7 @@ private void InitCreateUser(GeneralLoginUpPartyViewModel generalLoginUpParty) if (element.Type == DynamicElementTypes.EmailAndPassword) { element.IsStaticRequired = true; + element.Required = true; } } } diff --git a/src/FoxIDs.ControlClient/Shared/Components/FInputToggle.razor b/src/FoxIDs.ControlClient/Shared/Components/FInputToggle.razor index 9a81320e..d09889a8 100644 --- a/src/FoxIDs.ControlClient/Shared/Components/FInputToggle.razor +++ b/src/FoxIDs.ControlClient/Shared/Components/FInputToggle.razor @@ -74,6 +74,11 @@ private async Task ToggleCurrentValueAsync() { + if (Disabled) + { + return; + } + var oldCurrentValue = CurrentValue; if (CurrentValue == true) { diff --git a/src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj b/src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj index e2cf1bbd..eb40b81f 100644 --- a/src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj +++ b/src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj @@ -2,7 +2,7 @@ net8.0 - 1.12.4 + 1.12.7 FoxIDs Anders Revsgaard ITfoxtec diff --git a/src/FoxIDs.Shared/FoxIDs.Shared.csproj b/src/FoxIDs.Shared/FoxIDs.Shared.csproj index aaaf7592..cb35cbf1 100644 --- a/src/FoxIDs.Shared/FoxIDs.Shared.csproj +++ b/src/FoxIDs.Shared/FoxIDs.Shared.csproj @@ -2,7 +2,7 @@ net8.0 - 1.12.4 + 1.12.7 FoxIDs Anders Revsgaard ITfoxtec diff --git a/src/FoxIDs.Shared/Infrastructure/Hosting/RouteBindingMiddleware.cs b/src/FoxIDs.Shared/Infrastructure/Hosting/RouteBindingMiddleware.cs index 1eb2caf5..247538bb 100644 --- a/src/FoxIDs.Shared/Infrastructure/Hosting/RouteBindingMiddleware.cs +++ b/src/FoxIDs.Shared/Infrastructure/Hosting/RouteBindingMiddleware.cs @@ -81,9 +81,7 @@ private bool GetUseCustomDomain(string[] route, string customDomain) private async Task GetRouteDataAsync(TelemetryScopedLogger scopedLogger, IServiceProvider requestServices, Track.IdKey trackIdKey, bool useCustomDomain, string customDomain, string partyNameAndBinding, bool acceptUnknownParty) { var tenant = await GetTenantAsync(requestServices, useCustomDomain, customDomain, trackIdKey.TenantName); - - var useCustomDomainVerified = useCustomDomain && !tenant.CustomDomain.IsNullOrEmpty() && tenant.CustomDomainVerified; - if (useCustomDomainVerified) + if (useCustomDomain) { trackIdKey.TenantName = tenant.Name; } @@ -91,20 +89,22 @@ private async Task GetRouteDataAsync(TelemetryScopedLogger scopedL var plan = await GetPlanAsync(requestServices, tenant.PlanName); if (plan != null) { - if (useCustomDomainVerified && !plan.EnableCustomDomain) + if (useCustomDomain && !plan.EnableCustomDomain) { throw new Exception($"Custom domain is not supported in the '{plan.Name}' plan."); } } - var track = await GetTrackAsync(scopedLogger, requestServices, trackIdKey, useCustomDomainVerified); + var track = await GetTrackAsync(scopedLogger, requestServices, trackIdKey, useCustomDomain); scopedLogger.SetScopeProperty(Constants.Logs.TenantName, trackIdKey.TenantName); scopedLogger.SetScopeProperty(Constants.Logs.TrackName, trackIdKey.TrackName); + var hasVerifiedCustomDomain = !tenant.CustomDomain.IsNullOrEmpty() && tenant.CustomDomainVerified; var routeBinding = new RouteBinding { - UseCustomDomain = useCustomDomainVerified, + HasVerifiedCustomDomain = hasVerifiedCustomDomain, + UseCustomDomain = useCustomDomain && hasVerifiedCustomDomain, CustomDomain = tenant.CustomDomain, - RouteUrl = $"{(!useCustomDomainVerified ? $"{trackIdKey.TenantName}/" : string.Empty)}{trackIdKey.TrackName}{(!partyNameAndBinding.IsNullOrWhiteSpace() ? $"/{partyNameAndBinding}" : string.Empty)}", + RouteUrl = $"{(!useCustomDomain ? $"{trackIdKey.TenantName}/" : string.Empty)}{trackIdKey.TrackName}{(!partyNameAndBinding.IsNullOrWhiteSpace() ? $"/{partyNameAndBinding}" : string.Empty)}", PlanName = plan?.Name, TenantName = trackIdKey.TenantName, TrackName = trackIdKey.TrackName, diff --git a/src/FoxIDs.Shared/Models/Routes/RouteBinding.cs b/src/FoxIDs.Shared/Models/Routes/RouteBinding.cs index 50bc162b..72fcdb58 100644 --- a/src/FoxIDs.Shared/Models/Routes/RouteBinding.cs +++ b/src/FoxIDs.Shared/Models/Routes/RouteBinding.cs @@ -4,6 +4,8 @@ namespace FoxIDs.Models { public class RouteBinding { + public bool HasVerifiedCustomDomain { get; set; } + public bool UseCustomDomain { get; set; } public string CustomDomain { get; set; } diff --git a/src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj b/src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj index a5549fca..61a051f5 100644 --- a/src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj +++ b/src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj @@ -2,7 +2,7 @@ net8.0 - 1.12.4 + 1.12.7 FoxIDs Anders Revsgaard ITfoxtec diff --git a/src/FoxIDs/FoxIDs.csproj b/src/FoxIDs/FoxIDs.csproj index c1fa5451..137b3860 100644 --- a/src/FoxIDs/FoxIDs.csproj +++ b/src/FoxIDs/FoxIDs.csproj @@ -1,7 +1,7 @@  net8.0 - 1.12.4 + 1.12.7 FoxIDs Anders Revsgaard ITfoxtec diff --git a/src/FoxIDs/Logic/Tracks/SendEmailLogic.cs b/src/FoxIDs/Logic/Tracks/SendEmailLogic.cs index b079ba67..42388bdb 100644 --- a/src/FoxIDs/Logic/Tracks/SendEmailLogic.cs +++ b/src/FoxIDs/Logic/Tracks/SendEmailLogic.cs @@ -179,7 +179,7 @@ private SendEmail GetSettings() { return new SendEmail { - FromName =settings.Smtp.FromName, + FromName = settings.Smtp.FromName, FromEmail = settings.Smtp.FromEmail, SmtpHost = settings.Smtp.Host, SmtpPort = settings.Smtp.Port,