Skip to content

Commit

Permalink
Merge pull request #1053 from ITfoxtec/1.12.x-development
Browse files Browse the repository at this point in the history
1.12.x development
  • Loading branch information
Revsgaard authored Nov 26, 2024
2 parents cb9c3e1 + 60545bc commit a40fc98
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.HasVerifiedCustomDomain;

var urlItems = new List<string>();
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)
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs.Control/FoxIDs.Control.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.12.5</Version>
<Version>1.12.6</Version>
<RootNamespace>FoxIDs</RootNamespace>
<Authors>Anders Revsgaard</Authors>
<Company>ITfoxtec</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.12.5</Version>
<Version>1.12.6</Version>
<RootNamespace>FoxIDs.Client</RootNamespace>
<Authors>Anders Revsgaard</Authors>
<Company>ITfoxtec</Company>
Expand Down
15 changes: 13 additions & 2 deletions src/FoxIDs.ControlClient/Pages/Components/ELoginUpParty.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
using FoxIDs.Client.Models.ViewModels;
using System;
using System.Linq;
using System.Threading.Tasks;
using FoxIDs.Infrastructure;
using FoxIDs.Client.Services;
using Microsoft.AspNetCore.Components.Forms;
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
{
Expand Down Expand Up @@ -62,6 +61,18 @@ private LoginUpPartyViewModel ToViewModel(LoginUpParty loginUpParty)
{
afterMap.CreateUser.ClaimTransforms = afterMap.CreateUser.ClaimTransforms.MapOAuthClaimTransforms();
}

if (afterMap.CreateUser.Elements?.Any() == true)
{
foreach (var element in afterMap.CreateUser.Elements)
{
if (element.Type == DynamicElementTypes.EmailAndPassword)
{
element.IsStaticRequired = true;
element.Required = true;
}
}
}
});
}

Expand Down
1 change: 1 addition & 0 deletions src/FoxIDs.ControlClient/Pages/Components/UpPartyBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private void InitCreateUser(GeneralLoginUpPartyViewModel generalLoginUpParty)
if (element.Type == DynamicElementTypes.EmailAndPassword)
{
element.IsStaticRequired = true;
element.Required = true;
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/FoxIDs.ControlClient/Shared/Components/FInputToggle.razor
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@

private async Task ToggleCurrentValueAsync()
{
if (Disabled)
{
return;
}

var oldCurrentValue = CurrentValue;
if (CurrentValue == true)
{
Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.12.5</Version>
<Version>1.12.6</Version>
<RootNamespace>FoxIDs</RootNamespace>
<Authors>Anders Revsgaard</Authors>
<Company>ITfoxtec</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs.Shared/FoxIDs.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.12.5</Version>
<Version>1.12.6</Version>
<RootNamespace>FoxIDs</RootNamespace>
<Authors>Anders Revsgaard</Authors>
<Company>ITfoxtec</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.12.5</Version>
<Version>1.12.6</Version>
<RootNamespace>FoxIDs</RootNamespace>
<Authors>Anders Revsgaard</Authors>
<Company>ITfoxtec</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs/FoxIDs.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Version>1.12.5</Version>
<Version>1.12.6</Version>
<RootNamespace>FoxIDs</RootNamespace>
<Authors>Anders Revsgaard</Authors>
<Company>ITfoxtec</Company>
Expand Down
2 changes: 1 addition & 1 deletion src/FoxIDs/Logic/Tracks/SendEmailLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a40fc98

Please sign in to comment.