Skip to content

Commit d86de3a

Browse files
authored
Merge pull request #1294 from ITfoxtec/2.4.x-development
2.4.x development
2 parents 75a3e17 + 5be7443 commit d86de3a

File tree

12 files changed

+56
-16
lines changed

12 files changed

+56
-16
lines changed

Kubernetes/k8s-foxids-ingress-deployment.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ metadata:
55
annotations:
66
# Rate Limiting, docs https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#rate-limiting
77
#nginx.ingress.kubernetes.io/limit-whitelist: "x.x.x.x/x" # Configure the internal network to be excluded from rate-limiting, you can specify a list of IPs or CIDRs to allow
8-
#nginx.ingress.kubernetes.io/limit-connections: "20" # Limit the number of connections per IP address
9-
#nginx.ingress.kubernetes.io/limit-rpm: "300" # Limit the number of requests per minute per IP address
10-
#nginx.ingress.kubernetes.io/limit-rps: "10" # Limit the number of requests per second per IP address
8+
#nginx.ingress.kubernetes.io/limit-connections: "200" # Limit the number of connections per IP address
9+
#nginx.ingress.kubernetes.io/limit-rpm: "600" # Limit the number of requests per minute per IP address
10+
#nginx.ingress.kubernetes.io/limit-rps: "200" # Limit the number of requests per second per IP address
1111
#Buffer
1212
nginx.ingress.kubernetes.io/proxy-buffers-number: "4"
1313
nginx.ingress.kubernetes.io/proxy-buffer-size: "32k"

Kubernetes/k8s-redis-deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ spec:
1919
- containerPort: 6379
2020
volumeMounts:
2121
- mountPath: /data
22-
name: redis-data
22+
name: redis-data
23+
securityContext:
24+
allowPrivilegeEscalation: false # Prevent privilege escalation in this container
2325
volumes:
2426
- name: redis-data
2527
persistentVolumeClaim:

src/FoxIDs.Control/FoxIDs.Control.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.3.7</Version>
5+
<Version>2.3.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.ControlClient/FoxIDs.ControlClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.3.7</Version>
5+
<Version>2.3.9</Version>
66
<RootNamespace>FoxIDs.Client</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.ControlClient/Models/ViewModels/Parties/OidcDownPartyViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public class OidcDownPartyViewModel : IValidatableObject, IDownPartyName, IAllow
7474
/// Test URL
7575
/// </summary>
7676
[MaxLength(Constants.Models.DownParty.UrlLengthMax)]
77+
[Display(Name = "Alternatively, start the test with this test URL")]
7778
public string TestUrl { get; set; }
7879

7980
/// <summary>

src/FoxIDs.ControlClient/Pages/Users/InternalUsers.razor

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@
113113
</div>
114114
<label class="label-control">Two-factor</label>
115115
</div>
116+
}
117+
else
118+
{
119+
<FInputToggle @bind-Value="user.Form.Model.RequireMultiFactor" For="@(() => user.Form.Model.RequireMultiFactor)" TextType="y.n" />
116120
}
117121
<div class="form-group active-group active">
118122
<Label For="@(() => user.Form.Model.Claims)" class="label-control" />

src/FoxIDs.ControlShared/FoxIDs.ControlShared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.3.7</Version>
5+
<Version>2.3.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.Shared/FoxIDs.Shared.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.3.7</Version>
5+
<Version>2.3.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs.SharedBase/FoxIDs.SharedBase.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>
5-
<Version>2.3.7</Version>
5+
<Version>2.3.9</Version>
66
<RootNamespace>FoxIDs</RootNamespace>
77
<Authors>Anders Revsgaard</Authors>
88
<Company>FoxIDs</Company>

src/FoxIDs/Controllers/LoginController.cs

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,16 @@ public async Task<IActionResult> Login(bool passwordAuth = false, bool passwordL
8585
}
8686

8787
if (!(sequenceData.DoLoginPasswordAction || sequenceData.DoLoginPasswordlessEmailAction || sequenceData.DoLoginPasswordlessSmsAction))
88-
{
89-
sequenceData.DoLoginIdentifierStep = true;
90-
await sequenceLogic.SaveSequenceDataAsync(sequenceData);
88+
{
89+
if (!sequenceData.LoginHint.IsNullOrWhiteSpace())
90+
{
91+
return await StartAuthenticationInternalLoginHintAsync(sequenceData);
92+
}
93+
else
94+
{
95+
sequenceData.DoLoginIdentifierStep = true;
96+
await sequenceLogic.SaveSequenceDataAsync(sequenceData);
97+
}
9198
}
9299
else
93100
{
@@ -487,10 +494,36 @@ private LoginRequest GetLoginRequest(LoginUpSequenceData sequenceData)
487494
LoginAction = sequenceData.LoginAction,
488495
UserId = sequenceData.UserId,
489496
MaxAge = sequenceData.MaxAge,
490-
LoginHint = sequenceData.LoginHint,
497+
LoginHint = sequenceData.UserIdentifier,
491498
Acr = sequenceData.Acr
492499
};
493-
}
500+
}
501+
502+
private async Task<IActionResult> StartAuthenticationInternalLoginHintAsync(LoginUpSequenceData sequenceData)
503+
{
504+
try
505+
{
506+
logger.ScopeTrace(() => "Start authentication with login hint.");
507+
loginPageLogic.CheckUpParty(sequenceData);
508+
var loginUpParty = await tenantDataRepository.GetAsync<LoginUpParty>(sequenceData.UpPartyId);
509+
securityHeaderLogic.AddImgSrc(loginUpParty.IconUrl);
510+
securityHeaderLogic.AddImgSrcFromCss(loginUpParty.Css);
511+
512+
sequenceData.DoLoginIdentifierStep = false;
513+
if (sequenceData.LoginHint.IsNullOrWhiteSpace())
514+
{
515+
throw new InvalidOperationException("Login hint is required and cannot be empty.");
516+
}
517+
sequenceData.UserIdentifier = sequenceData.LoginHint;
518+
sequenceData.LoginHint = null; // Clear login hint so it is not used again.
519+
await sequenceLogic.SaveSequenceDataAsync(sequenceData);
520+
return await StartAuthenticationInternalAsync(sequenceData, loginUpParty);
521+
}
522+
catch (Exception ex)
523+
{
524+
throw new EndpointException($"Authentication with login hint failed, Name '{RouteBinding.UpParty.Name}'.", ex) { RouteBinding = RouteBinding };
525+
}
526+
}
494527

495528
private async Task<IActionResult> StartAuthenticationInternalAsync(LoginUpSequenceData sequenceData, LoginUpParty loginUpParty)
496529
{

0 commit comments

Comments
 (0)