-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.0 BlazorWebAppOidc IDX21323: RequireNonce is 'False' #53585
Comments
Thanks @travaille-dev. The sample app is in the Blazor samples repo ... https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorWebAppOidc The Note @halter73 (if you'll be working this when you return in February), that the OIDC sample in that folder is now a non-BFF version of your sample app. Your sample app is at https://github.com/dotnet/blazor-samples/tree/main/8.0/BlazorWebAppOidcBff. The article that I'm placing will use pivots to cover them. One pivot will be focused on the non-BFF (no Aspire, no YARP) scenario, and the other pivot will be on your BFF with Aspire/YARP scenario. Also note that as of this morning (Wednesday, 1/24), I haven't even reached running either sample with Entra. The non-BFF sample is untested (by 🦖) at this time. I was happy to hear that thus far @travaille-dev had some luck with it running until this 💥 happened on the nonce. I will test with Entra here soon (Thursday, I hope 🤞🍀). |
I did want to add that I would be all right with focusing on the non BFF scenario. I'm primarily interested in aligning my auth scenario with auto rendering.
|
I have run into this snag as well which manifests as our site (deployed to an on prem server but using hosted Azure Entra ID for auth) being unavailable if left idle past the token refresh period (1 hour?). The end user sees an HTTP 500 error and we see the detailed exception that @travaille-dev posted in the submission (IDX21323). In digging into the
TL;DR Even if My proposed workaround for this is to set the
Additionally, when constructing the
The security implication for this is that we are essentially bypassing the |
I just want to note here that at least one source of this (possibly THE source) is ... Stale cookies are the devils playground! 😈😆I just hit that while working a different samples repo issue. I already have guidance in the WASM-focused articles on using an InPrivate/incognito browser for testing, and I'm going to place those remarks in the BWA+OIDC article as well. Anyone hitting this nonce error should first either clear cookies and try again or open an InPrivate/incognito browser window and access the app from there. There's guidance in the article on how to configure your VS to do that automatically in some of the WASM-focused security articles, which saves time while testing/debugging. |
@mkArtakMSFT ... I think we've addressed this. @halter73 made the changes to the sample app on dotnet/blazor-samples#240, and I included a short section on it in the doc per dotnet/AspNetCore.Docs#32081, which states ...
|
Is there an existing issue for this?
Describe the bug
When running this blazor sample initially the authentication works well, but if you idle on the page (I'm assuming until the auth token needs to be refreshed) then you get this nonce error.
Since the error is pointing to the CookieOidcRefresher file I was wondering if I can get some direction on how to implement a fix for this.
Expected Behavior
I expect for the token to be refreshed in the background if it has expired.
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
8.0.200-preview.23624.5
Anything else?
.NET SDK:
Version: 8.0.200-preview.23624.5
Commit: 8065b9770c
Workload version: 8.0.200-manifests.ba313bcd
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19045
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.200-preview.23624.5\
.NET workloads installed:
Workload version: 8.0.200-manifests.ba313bcd
[aspire]
Installation Source: SDK 8.0.200-preview.23624, VS 17.9.34511.98
Manifest Version: 8.0.0-preview.2.23619.3/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.0.0-preview.2.23619.3\WorkloadManifest.json
Install Type: Msi
[wasm-tools]
Installation Source: VS 17.8.34511.84, VS 17.9.34511.98
Manifest Version: 8.0.1/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.workload.mono.toolchain.current\8.0.1\WorkloadManifest.json
Install Type: Msi
Host:
Version: 8.0.1
Architecture: x64
Commit: bf5e279d92
.NET SDKs installed:
6.0.418 [C:\Program Files\dotnet\sdk]
7.0.102 [C:\Program Files\dotnet\sdk]
8.0.101 [C:\Program Files\dotnet\sdk]
8.0.200-preview.23624.5 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.26 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
cc: @guardrex dotnet/blazor-samples#173
The text was updated successfully, but these errors were encountered: