Skip to content

Commit a33d24b

Browse files
RolandGuijtRoland Guijt
andauthored
Revised Blazor qs (#288)
Co-authored-by: Roland Guijt <roland.guijt@duendesoftware.com>
1 parent 91353b1 commit a33d24b

File tree

104 files changed

+60236
-1383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+60236
-1383
lines changed

IdentityServer/v7/Configuration/Permissions/identifier.sqlite

Whitespace-only changes.
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
IdentityServer:
2+
bin HostingExtensions.cs keys Pages Properties
3+
Config.cs IdentityServer.csproj obj Program.cs wwwroot
4+
IdentityServer/bin:
5+
Debug
6+
IdentityServer/bin/Debug:
7+
net10.0
8+
IdentityServer/bin/Debug/net10.0:
9+
Aspire.ServiceDefaults.dll
10+
Aspire.ServiceDefaults.pdb
11+
Duende.IdentityModel.dll
12+
Duende.IdentityServer.dll
13+
Duende.IdentityServer.Storage.dll
14+
IdentityServer
15+
IdentityServer.deps.json
16+
IdentityServer.dll
17+
IdentityServer.pdb
18+
IdentityServer.runtimeconfig.json
19+
IdentityServer.staticwebassets.endpoints.json
20+
IdentityServer.staticwebassets.runtime.json
21+
keys
22+
Microsoft.AspNetCore.Authentication.OpenIdConnect.dll
23+
Microsoft.Extensions.AmbientMetadata.Application.dll
24+
Microsoft.Extensions.Compliance.Abstractions.dll
25+
Microsoft.Extensions.DependencyInjection.AutoActivation.dll
26+
Microsoft.Extensions.DependencyModel.dll
27+
Microsoft.Extensions.Diagnostics.ExceptionSummarization.dll
28+
Microsoft.Extensions.Http.Diagnostics.dll
29+
Microsoft.Extensions.Http.Resilience.dll
30+
Microsoft.Extensions.Resilience.dll
31+
Microsoft.Extensions.ServiceDiscovery.Abstractions.dll
32+
Microsoft.Extensions.ServiceDiscovery.dll
33+
Microsoft.Extensions.Telemetry.Abstractions.dll
34+
Microsoft.Extensions.Telemetry.dll
35+
Microsoft.IdentityModel.Abstractions.dll
36+
Microsoft.IdentityModel.JsonWebTokens.dll
37+
Microsoft.IdentityModel.Logging.dll
38+
Microsoft.IdentityModel.Protocols.dll
39+
Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
40+
Microsoft.IdentityModel.Tokens.dll
41+
OpenTelemetry.Api.dll
42+
OpenTelemetry.Api.ProviderBuilderExtensions.dll
43+
OpenTelemetry.dll
44+
OpenTelemetry.Exporter.OpenTelemetryProtocol.dll
45+
OpenTelemetry.Extensions.Hosting.dll
46+
OpenTelemetry.Instrumentation.AspNetCore.dll
47+
OpenTelemetry.Instrumentation.GrpcNetClient.dll
48+
OpenTelemetry.Instrumentation.Http.dll
49+
OpenTelemetry.Instrumentation.Runtime.dll
50+
Polly.Core.dll
51+
Polly.Extensions.dll
52+
Polly.RateLimiting.dll
53+
Serilog.AspNetCore.dll
54+
Serilog.dll
55+
Serilog.Extensions.Hosting.dll
56+
Serilog.Extensions.Logging.dll
57+
Serilog.Formatting.Compact.dll
58+
Serilog.Settings.Configuration.dll
59+
Serilog.Sinks.Console.dll
60+
Serilog.Sinks.Debug.dll
61+
Serilog.Sinks.File.dll
62+
System.IdentityModel.Tokens.Jwt.dll
63+
IdentityServer/bin/Debug/net10.0/keys:
64+
is-signing-key-11124551225742F3D5B14A98948855A7.json
65+
IdentityServer/keys:
66+
is-signing-key-11124551225742F3D5B14A98948855A7.json
67+
IdentityServer/obj:
68+
Debug project.nuget.cache
69+
IdentityServer.csproj.nuget.dgspec.json project.packagespec.json
70+
IdentityServer.csproj.nuget.g.props rider.project.model.nuget.info
71+
IdentityServer.csproj.nuget.g.targets rider.project.restore.info
72+
project.assets.json
73+
IdentityServer/obj/Debug:
74+
net10.0
75+
IdentityServer/obj/Debug/net10.0:
76+
apphost
77+
compressed
78+
Identity.FDBE6C83.Up2Date
79+
IdentityServer.AssemblyInfo.cs
80+
IdentityServer.AssemblyInfoInputs.cache
81+
IdentityServer.assets.cache
82+
IdentityServer.csproj.AssemblyReference.cache
83+
IdentityServer.csproj.CoreCompileInputs.cache
84+
IdentityServer.csproj.FileListAbsolute.txt
85+
IdentityServer.dll
86+
IdentityServer.GeneratedMSBuildEditorConfig.editorconfig
87+
IdentityServer.genruntimeconfig.cache
88+
IdentityServer.GlobalUsings.g.cs
89+
IdentityServer.MvcApplicationPartsAssemblyInfo.cache
90+
IdentityServer.pdb
91+
IdentityServer.RazorAssemblyInfo.cache
92+
IdentityServer.RazorAssemblyInfo.cs
93+
IdentityServer.sourcelink.json
94+
rbcswa.dswa.cache.json
95+
ref
96+
refint
97+
rjimswa.dswa.cache.json
98+
rjsmcshtml.dswa.cache.json
99+
rjsmrazor.dswa.cache.json
100+
rpswa.dswa.cache.json
101+
staticwebassets
102+
staticwebassets.build.endpoints.json
103+
staticwebassets.build.json
104+
staticwebassets.build.json.cache
105+
staticwebassets.development.json
106+
swae.build.ex.cache
107+
IdentityServer/obj/Debug/net10.0/compressed:
108+
0ouvb1wwxx-{0}-33bcjk7gyg-33bcjk7gyg.gz
109+
26725elcve-{0}-m4xw55ispg-m4xw55ispg.gz
110+
2qiwwvvzy9-{0}-4a76qqeh1j-4a76qqeh1j.gz
111+
32oxmv53fo-{0}-6w8okl6t67-6w8okl6t67.gz
112+
3c113tcfur-{0}-dlkct352rx-dlkct352rx.gz
113+
3pyb8v3x0p-{0}-vwa26bmbsk-vwa26bmbsk.gz
114+
5d7joa7emr-{0}-l5aubhu0bo-l5aubhu0bo.gz
115+
5z1yb3vfii-{0}-hz64uadaut-hz64uadaut.gz
116+
7r6o3indm7-{0}-qf3xwza7k1-qf3xwza7k1.gz
117+
84uewl3zf7-{0}-ylw7lh1xni-ylw7lh1xni.gz
118+
86ebyaf8fj-{0}-v56xyg1lj8-v56xyg1lj8.gz
119+
8tdtjkhq5z-{0}-c8jjcjvi6o-c8jjcjvi6o.gz
120+
9ahrz4jw1w-{0}-pbe9k3zi67-pbe9k3zi67.gz
121+
a20kzdhjs9-{0}-516mnhqjuj-516mnhqjuj.gz
122+
a85ig1x9vn-{0}-9rqdqbz9l5-9rqdqbz9l5.gz
123+
az018l64gb-{0}-maky9z0zlp-maky9z0zlp.gz
124+
b0axnw6g6b-{0}-569jtchv1l-569jtchv1l.gz
125+
cxh1msjq7f-{0}-v2ivwpkqad-v2ivwpkqad.gz
126+
d4hcu8c4bl-{0}-r27yxon8ig-r27yxon8ig.gz
127+
ddbzxybs03-{0}-yvnwahudtr-yvnwahudtr.gz
128+
drraycx4qs-{0}-0zglhag6zb-0zglhag6zb.gz
129+
g3sfwz1abi-{0}-i6jovj3f6q-i6jovj3f6q.gz
130+
h543q1ys1s-{0}-wkvz2kpl07-wkvz2kpl07.gz
131+
h6y9ppatkk-{0}-gvt36kw2jb-gvt36kw2jb.gz
132+
h7zkl4d7kp-{0}-ismbivwgyj-ismbivwgyj.gz
133+
hf5aju0edh-{0}-j3c2yxqwht-j3c2yxqwht.gz
134+
iqjiwxe7og-{0}-5trh6b1mit-5trh6b1mit.gz
135+
kgjhhfwggh-{0}-2hk6trcn89-2hk6trcn89.gz
136+
kqeutnx79t-{0}-dtb4w11tg4-dtb4w11tg4.gz
137+
m2bnshwhs6-{0}-dsw5v3fbc5-dsw5v3fbc5.gz
138+
mbkj9qbr5t-{0}-yks9jwqdnr-yks9jwqdnr.gz
139+
n2br1b19cz-{0}-poap4f3u6o-poap4f3u6o.gz
140+
nfkv0i6nof-{0}-owsa6kxplw-owsa6kxplw.gz
141+
niqja72aps-{0}-80qsln72n7-80qsln72n7.gz
142+
p6bcgl80t0-{0}-3h6z8rn2jh-3h6z8rn2jh.gz
143+
tbaw105om5-{0}-x0syeyqenc-x0syeyqenc.gz
144+
w2b2zxfdhm-{0}-4t2ehcb3e4-4t2ehcb3e4.gz
145+
xz15245rbp-{0}-masyeah4yd-masyeah4yd.gz
146+
y332r0qnha-{0}-t0knxd0p3j-t0knxd0p3j.gz
147+
yev70dsv35-{0}-oljugxoxj0-oljugxoxj0.gz
148+
IdentityServer/obj/Debug/net10.0/ref:
149+
IdentityServer.dll
150+
IdentityServer/obj/Debug/net10.0/refint:
151+
IdentityServer.dll
152+
IdentityServer/obj/Debug/net10.0/staticwebassets:
153+
IdentityServer/Pages:
154+
Account Grants SecurityHeadersAttribute.cs
155+
Ciba Home ServerSideSessions
156+
Consent IdentityServerSuppressions.cs Shared
157+
Device Index.cshtml Telemetry.cs
158+
Diagnostics Index.cshtml.cs TestUsers.cs
159+
Extensions.cs Log.cs _ViewImports.cshtml
160+
ExternalLogin Redirect _ViewStart.cshtml
161+
IdentityServer/Pages/Account:
162+
AccessDenied.cshtml AccessDenied.cshtml.cs Create Login Logout
163+
IdentityServer/Pages/Account/Create:
164+
Index.cshtml Index.cshtml.cs InputModel.cs
165+
IdentityServer/Pages/Account/Login:
166+
Index.cshtml Index.cshtml.cs InputModel.cs LoginOptions.cs ViewModel.cs
167+
IdentityServer/Pages/Account/Logout:
168+
Index.cshtml LoggedOut.cshtml LoggedOutViewModel.cs
169+
Index.cshtml.cs LoggedOut.cshtml.cs LogoutOptions.cs
170+
IdentityServer/Pages/Ciba:
171+
All.cshtml Consent.cshtml.cs Index.cshtml.cs ViewModel.cs
172+
All.cshtml.cs ConsentOptions.cs InputModel.cs
173+
Consent.cshtml Index.cshtml _ScopeListItem.cshtml
174+
IdentityServer/Pages/Consent:
175+
ConsentOptions.cs Index.cshtml.cs _ScopeListItem.cshtml
176+
Index.cshtml InputModel.cs ViewModel.cs
177+
IdentityServer/Pages/Device:
178+
DeviceOptions.cs Index.cshtml.cs _ScopeListItem.cshtml Success.cshtml.cs
179+
Index.cshtml InputModel.cs Success.cshtml ViewModel.cs
180+
IdentityServer/Pages/Diagnostics:
181+
Index.cshtml Index.cshtml.cs ViewModel.cs
182+
IdentityServer/Pages/ExternalLogin:
183+
Callback.cshtml Callback.cshtml.cs Challenge.cshtml Challenge.cshtml.cs
184+
IdentityServer/Pages/Grants:
185+
Index.cshtml Index.cshtml.cs ViewModel.cs
186+
IdentityServer/Pages/Home:
187+
Error
188+
IdentityServer/Pages/Home/Error:
189+
Index.cshtml Index.cshtml.cs ViewModel.cs
190+
IdentityServer/Pages/Redirect:
191+
Index.cshtml Index.cshtml.cs
192+
IdentityServer/Pages/ServerSideSessions:
193+
Index.cshtml Index.cshtml.cs
194+
IdentityServer/Pages/Shared:
195+
_Layout.cshtml _Nav.cshtml _ValidationSummary.cshtml
196+
IdentityServer/Properties:
197+
launchSettings.json
198+
IdentityServer/wwwroot:
199+
css duende-logo.svg favicon.ico js lib
200+
IdentityServer/wwwroot/css:
201+
site.css site.min.css site.scss
202+
IdentityServer/wwwroot/js:
203+
signin-redirect.js signout-redirect.js
204+
IdentityServer/wwwroot/lib:
205+
bootstrap bootstrap4-glyphicons jquery
206+
IdentityServer/wwwroot/lib/bootstrap:
207+
dist LICENSE README.md
208+
IdentityServer/wwwroot/lib/bootstrap/dist:
209+
css js
210+
IdentityServer/wwwroot/lib/bootstrap/dist/css:
211+
bootstrap.css bootstrap.min.css
212+
bootstrap.css.map bootstrap.min.css.map
213+
bootstrap-grid.css bootstrap-reboot.css
214+
bootstrap-grid.css.map bootstrap-reboot.css.map
215+
bootstrap-grid.min.css bootstrap-reboot.min.css
216+
bootstrap-grid.min.css.map bootstrap-reboot.min.css.map
217+
IdentityServer/wwwroot/lib/bootstrap/dist/js:
218+
bootstrap.bundle.js bootstrap.bundle.min.js.map bootstrap.min.js
219+
bootstrap.bundle.js.map bootstrap.js bootstrap.min.js.map
220+
bootstrap.bundle.min.js bootstrap.js.map
221+
IdentityServer/wwwroot/lib/bootstrap4-glyphicons:
222+
css fonts LICENSE maps
223+
IdentityServer/wwwroot/lib/bootstrap4-glyphicons/css:
224+
bootstrap-glyphicons.css bootstrap-glyphicons.min.css
225+
IdentityServer/wwwroot/lib/bootstrap4-glyphicons/fonts:
226+
glyphicons
227+
IdentityServer/wwwroot/lib/bootstrap4-glyphicons/fonts/glyphicons:
228+
glyphicons-halflings-regular.eot glyphicons-halflings-regular.woff
229+
glyphicons-halflings-regular.svg glyphicons-halflings-regular.woff2
230+
glyphicons-halflings-regular.ttf
231+
IdentityServer/wwwroot/lib/bootstrap4-glyphicons/maps:
232+
glyphicons-fontawesome.css glyphicons-fontawesome.min.css
233+
glyphicons-fontawesome.less
234+
IdentityServer/wwwroot/lib/jquery:
235+
dist LICENSE.txt README.md
236+
IdentityServer/wwwroot/lib/jquery/dist:
237+
jquery.js jquery.min.map jquery.slim.min.js
238+
jquery.min.js jquery.slim.js jquery.slim.min.map

IdentityServer/v7/Quickstarts/6_JS_without_backend/src/Api/Api.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.2" />
1212
</ItemGroup>
1313

1414
</Project>

IdentityServer/v7/Quickstarts/6_JS_without_backend/src/Client/Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Duende.IdentityModel" Version="7.1.0" />
11+
<PackageReference Include="Duende.IdentityModel" Version="8.0.0" />
1212
</ItemGroup>
1313

1414
</Project>

IdentityServer/v7/Quickstarts/6_JS_without_backend/src/IdentityServer/IdentityServer.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Duende.IdentityServer" Version="7.3.2"/>
11-
<PackageReference Include="Google.Apis.Auth.AspNetCore3" Version="1.69.0" />
12-
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
10+
<PackageReference Include="Duende.IdentityServer" Version="7.4.4" />
11+
<PackageReference Include="Google.Apis.Auth.AspNetCore3" Version="1.73.0" />
12+
<PackageReference Include="Serilog.AspNetCore" Version="10.0.0" />
1313
</ItemGroup>
1414
</Project>

IdentityServer/v7/Quickstarts/6_JS_without_backend/src/IdentityServer/Pages/Diagnostics/ViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Copyright (c) Duende Software. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4+
using System.Buffers.Text;
45
using System.Text;
56
using System.Text.Json;
6-
using Duende.IdentityModel;
77
using Microsoft.AspNetCore.Authentication;
88

99
namespace IdentityServer.Pages.Diagnostics;
@@ -18,7 +18,7 @@ public ViewModel(AuthenticateResult result)
1818
{
1919
if (encoded != null)
2020
{
21-
var bytes = Base64Url.Decode(encoded);
21+
var bytes = Base64Url.DecodeFromChars(encoded);
2222
var value = Encoding.UTF8.GetString(bytes);
2323
Clients = JsonSerializer.Deserialize<string[]>(value) ?? Enumerable.Empty<string>();
2424
return;

IdentityServer/v7/Quickstarts/6_JS_without_backend/src/WebClient/WebClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.2" />
1111
</ItemGroup>
1212

1313
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net10.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<ProjectReference Include="..\BlazorWasm\BlazorWasm.csproj" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Duende.BFF" Version="4.0.2" />
15+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="10.0.2" />
16+
</ItemGroup>
17+
18+
</Project>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using Duende.Bff;
2+
using Microsoft.AspNetCore.Authentication;
3+
4+
var builder = WebApplication.CreateBuilder(args);
5+
6+
builder.Services.AddAuthorization();
7+
builder.Services.AddCascadingAuthenticationState();
8+
builder.Services
9+
.AddBff()
10+
.ConfigureOpenIdConnect(options =>
11+
{
12+
options.Authority = "https://demo.duendesoftware.com";
13+
14+
options.ClientId = "interactive.confidential";
15+
options.ClientSecret = "secret";
16+
options.ResponseType = "code";
17+
options.ResponseMode = "query";
18+
19+
options.Scope.Clear();
20+
options.Scope.Add("openid");
21+
options.Scope.Add("profile");
22+
options.Scope.Add("api");
23+
options.Scope.Add("offline_access");
24+
25+
options.MapInboundClaims = false;
26+
options.ClaimActions.MapAll();
27+
options.GetClaimsFromUserInfoEndpoint = true;
28+
options.SaveTokens = true;
29+
30+
options.TokenValidationParameters.NameClaimType = "name";
31+
options.TokenValidationParameters.RoleClaimType = "role";
32+
})
33+
.ConfigureCookies(options =>
34+
{
35+
options.Cookie.Name = "__Host-blazor";
36+
options.Cookie.SameSite = SameSiteMode.Strict;
37+
});
38+
39+
var app = builder.Build();
40+
41+
app.UseAuthentication();
42+
app.UseBff();
43+
app.UseAuthorization();
44+
45+
app.MapBffManagementEndpoints();
46+
47+
app.MapStaticAssets();
48+
49+
app.MapGet("/api/data", async () =>
50+
{
51+
var json = await File.ReadAllTextAsync("weather.json");
52+
return Results.Content(json, "application/json");
53+
}).RequireAuthorization().AsBffApiEndpoint();
54+
55+
app.MapFallbackToFile("index.html");
56+
57+
app.Run();
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
3+
"profiles": {
4+
"http": {
5+
"commandName": "Project",
6+
"dotnetRunMessages": true,
7+
"launchBrowser": true,
8+
"applicationUrl": "http://localhost:5267",
9+
"environmentVariables": {
10+
"ASPNETCORE_ENVIRONMENT": "Development"
11+
}
12+
},
13+
"https": {
14+
"commandName": "Project",
15+
"dotnetRunMessages": true,
16+
"launchBrowser": true,
17+
"applicationUrl": "https://localhost:7256;http://localhost:5267",
18+
"environmentVariables": {
19+
"ASPNETCORE_ENVIRONMENT": "Development"
20+
}
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)