添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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 ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question severity-blocking This label is used by an internal tool Status: Resolved

Describe the bug

When logging in, it seems to be successful, and then comes back to a page hanging at "Completing login..." with the following in the console:

info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed. These requirements were not met:
      DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

To Reproduce

Following this setup guide step-for-step with a brand new app produces the issue.

https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-microsoft-accounts?view=aspnetcore-5.0

Exceptions (if any)

info: Microsoft.AspNetCore.Authorization.DefaultAuthorizationService[2]
      Authorization failed. These requirements were not met:
      DenyAnonymousAuthorizationRequirement: Requires an authenticated user.

Further technical details

  • .NET 5
  • dotnet --info output:
  • .NET SDK (reflecting any global.json):
     Version:   5.0.100
     Commit:    5044b93829
    Runtime Environment:
     OS Name:     Windows
     OS Version:  10.0.18363
     OS Platform: Windows
     RID:         win10-x64
     Base Path:   C:\Program Files\dotnet\sdk\5.0.100\
    Host (useful for support):
      Version: 5.0.0
      Commit:  cf258a14b7
    .NET SDKs installed:
      3.1.301 [C:\Program Files\dotnet\sdk]
      5.0.100 [C:\Program Files\dotnet\sdk]
    .NET runtimes installed:
      Microsoft.AspNetCore.All 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
      Microsoft.AspNetCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
      Microsoft.NETCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
      Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
      Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
    
  • IDE: vscode latest
  • Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Nov 26, 2020

    Thanks for contacting us.
    We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

    Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Nov 26, 2020 Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. labels Nov 27, 2020

    Thanks for contacting us.
    We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

    I have this problem when the Identity Provider returns an error. Specifically I have a B2C custom policy. When this policy returns an error (as a result of REST call in the custom policy returning a 409), the Blazor app hangs in "Completing login...." and there does not seem to be a way to get at the error message and display it. Specifically, when the client posts to the authresp endpoint, it gets a redirect to

    https:///authentication/login-callback#error=server_error&error_description=AADB2C%3a+You+need+an+invitation+to+this+system.

    Along with more data like correlation id etc. The app hangs on this redirect.

    I have built my app on .NET 5 and it is based on the template project. It works fine for a valid login, although I think there might be a separate problem with refreshing the token and failing to do so.

    The doc says to use --tenant-id "common" when setting up. In our case, we have a tenant id because we are using org logins. Using our tenant id instead made logins from org work. I'm assuming common means general, non-org accounts.

    @marpinello Are you using organization accounts? If so, could you try using your tenant id from your AAD app and see if it works, to confirm?

    In my case (Blazor WASM on .NET 5.0.3 + ASP.NET Core Identity + IdentityServer4) , every things is OK on localhost.
    But, after publishing on remote shared hosting (Win Server 2019 + .NET 5.0.3) this situation will be happened.
    Every idea/solution/hack/... before next sprint, will be appreciated.

    In my case, I believe Azure AD was assuming implicit grant, but I didn't have implicit grant set in my Azure Portal.
    I added "ResponseType": "code", to specific the client is using Authorization Code Flow with PKCE solved problem.

    We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

    Looks like there are some successful experiences shared here and it's not clear if the issue is still relevant.
    @FrancisEgan can you please try this out again with the latest .NET 7 RC SDK and see if this is still an issue? Thanks!

    Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Oct 18, 2022

    Hi @FrancisEgan. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

    Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. and removed Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. labels Oct 19, 2022 Needs: Attention 👋 This issue needs the attention of a contributor, typically because the OP has provided an update. label Oct 19, 2022 ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. and removed investigate labels Oct 19, 2022 ✔️ Resolution: Answered Resolved because the question asked by the original author has been answered. question severity-blocking This label is used by an internal tool Status: Resolved