Blazor WebAssembly + Amazon Cognito

后端 未结 3 1295
离开以前
离开以前 2020-12-10 23:32

I would like to set up a Blazor client-side app with authentication through AWS Cognito.

When I run the app I\'m not redirected to

相关标签:
3条回答
  • 2020-12-10 23:51

    Response 1:

    While the authorizing message is displayed, the app check for a valid authentication and set up auto renew token iframe. If you look at the network log on your browser you'll see requests made by this time.
    When the app run in release it's faster.

    Response 2:

    You need to add authorization on pages you want to protect by adding the Authorize attribute.

    @page "/"
    @attribute [Authorize]
    
    
    0 讨论(0)
  • 2020-12-10 23:54

    I ended up switching from Cognito to Auth0 and upgrading from Api Gateway's RestApi to HttpApi, which includes built in JWT authorizer, and I am very happy with the change. Cognito just had too many problems in the end, but if someone is determined to get it to work check @aguafrommars's comments under the accepted answer.

    0 讨论(0)
  • 2020-12-10 23:54

    Had the same problem and switched out to Azure B2C which again resolved the issue. Appears to be a problem with the auth library when linking to AWS Cognito as the auth provider.

    Issues raised with MS - https://github.com/dotnet/aspnetcore/issues/22651

    0 讨论(0)
提交回复
热议问题