Skip to content

Commit 635f058

Browse files
author
github-actions
committed
feat(blazor): configure ciba + server side session options
1 parent 8861e03 commit 635f058

File tree

8 files changed

+51
-14
lines changed

8 files changed

+51
-14
lines changed

src/Aguacongas.TheIdServer.BlazorApp/README.md

+20-5
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,16 @@ The application obtains its configuration from appsettings.json and the environm
6767
"redirectUri": "https://localhost:5443/authentication/login-callback",
6868
"responseType": "code"
6969
},
70-
"welcomeContenUrl": "/welcome-fragment.html"
70+
"settingsOptions": {
71+
"typeName": "Aguacongas.TheIdServer.BlazorApp.Models.ServerConfig, Aguacongas.TheIdServer.BlazorApp.Infrastructure",
72+
"apiUrl": "https://localhost:5443/api/api/configuration"
73+
},
74+
"menuOptions": {
75+
"showSettings": true
76+
},
77+
"welcomeContenUrl": "https://localhost:5443/welcome-fragment.html",
78+
"serverSideSessionEnabled": false,
79+
"cibaEnabled": false
7180
}
7281
```
7382

@@ -149,12 +158,18 @@ This endpoint should return an HTML fragment.
149158
</p>
150159
```
151160

152-
## Client and API secrets
161+
## UI Options
162+
### Hide settings menu
163+
164+
To hide the settings menu, unset **menuOptions:showSettings**.
165+
166+
### Hide CIBA grant type
167+
168+
If CIBA is not enabled you can hide the CIBA grant type by unsetting cibaEnabled options.
153169

154-
The application doesn't generate secrets. Shared Secrets or x509 certificates require conversion before storing.
170+
### Hide coordinate lifetime with user session checkbox
155171

156-
* Convert a SharedSecret to SHA256 value.
157-
* Convert an X509 certificate to Base64 string.
172+
If server side sessions are not enable you can hide the coordinate lifetime with user session checkbox in client tokens section by unsetting serverSideSessionEnabled options.
158173

159174
## Additional resources
160175

src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.heroku.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
"postLogoutRedirectUri": "https://theidserver.herokuapp.com/authentication/logout-callback",
2323
"redirectUri": "https://theidserver.herokuapp.com/authentication/login-callback"
2424
},
25-
"welcomeContenUrl": "https://theidserver.herokuapp.com/api/welcomefragment"
25+
"welcomeContenUrl": "https://theidserver.herokuapp.com/api/welcomefragment",
26+
"serverSideSessionEnabled": false,
27+
"cibaEnabled": false
28+
2629
}

src/Aguacongas.TheIdServer.BlazorApp/wwwroot/appsettings.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@
3131
},
3232
"menuOptions": {
3333
"showSettings": true
34-
}
34+
},
35+
"serverSideSessionEnabled": true,
36+
"cibaEnabled": true
3537
}

src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Infrastructure/Models/Settings.cs

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ public class Settings
1515
public bool Prerendered { get; set; }
1616

1717
public string HostElementIdentifier { get; set; } = "app";
18+
19+
public bool ServerSideSessionEnabled { get; set; }
20+
21+
public bool CibaEnabled { get; set; }
1822
}
1923

2024
public class LoggingOptions

src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/ClientTokens.razor

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@inject IStringLocalizerAsync<ClientTokens> Localizer
2+
@inject IOptions<Settings> Options
23
@if (Model.ProtocolType == "oidc")
34
{
45
<div class="mb-3 row">
@@ -211,13 +212,16 @@
211212
<AuthorizedToken Name="sso-lifetime" QuickValues="_ssoLifetimeQuickValues" @bind-Value="@Model.UserSsoLifetime" TokenValueChanged="TokenChanded" />
212213
</div>
213214
</div>
214-
<div class="mb-3 row">
215-
<label class="col col-form-label" for="coordinate-lifetime-with-user-session">
216-
</label>
217-
<div class="col-lg-8 col-sm-12">
218-
<AuthorizeNullableCheckbox Name="coordinate-lifetime-with-user-session" @bind-Value="@Model.CoordinateLifetimeWithUserSession" Label="@Localizer["coordinate lifetime with user session"]" />
215+
@if (Options.Value.ServerSideSessionEnabled)
216+
{
217+
<div class="mb-3 row">
218+
<label class="col col-form-label" for="coordinate-lifetime-with-user-session">
219+
</label>
220+
<div class="col-lg-8 col-sm-12">
221+
<AuthorizeNullableCheckbox Name="coordinate-lifetime-with-user-session" @bind-Value="@Model.CoordinateLifetimeWithUserSession" Label="@Localizer["coordinate lifetime with user session"]" />
222+
</div>
219223
</div>
220-
</div>
224+
}
221225
@if (_showAllOptions || Model.IsDevice())
222226
{
223227
<div class="mb-3 row">

src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/GrantType.razor

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
@inherits AutoCompleteModel<Entity.ClientGrantType>
1+
2+
@inherits AutoCompleteModel<Entity.ClientGrantType>
3+
@inject IOptions<Settings> Options
24

35
@if (IsReadOnly)
46
{

src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/Components/GrantType.razor.cs

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ protected override Task<IEnumerable<string>> GetFilteredValues(string term, Canc
3737
(kv.Key == "authorization_code" || kv.Key == "implicit")) &&
3838
(kv.Value.Contains(term) || kv.Key.Contains(term)))
3939
.Select(kv => kv.Key);
40+
41+
if (!Options.Value.CibaEnabled)
42+
{
43+
result = result.Where(r => r != "ciba");
44+
}
45+
4046
return Task.FromResult(result);
4147
}
4248

src/BlazorApp/Aguacongas.TheIdServer.BlazorApp.Pages.Client/_Imports.razor

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@using Microsoft.AspNetCore.Components.Authorization
22
@using Microsoft.AspNetCore.Components.Forms
33
@using Microsoft.AspNetCore.Components.Web
4+
@using Microsoft.Extensions.Options
45
@using Aguacongas.IdentityServer.Store
56
@using Aguacongas.TheIdServer.BlazorApp.Components
67
@using Aguacongas.TheIdServer.BlazorApp.Components.Form

0 commit comments

Comments
 (0)