Git Product home page Git Product logo

Comments (9)

buehler avatar buehler commented on May 30, 2024 1

Maybe it could help to have the "AddZitadelAuthentciatioN" for blazor apps.

from zitadel-net.

buehler avatar buehler commented on May 30, 2024

Hey @KillTrot

I honestly don't know. In a Blazor Server App it should be possible, since everything is handled by the Kestrel server. On the other hand, in a Blazor Webassembly App, I'm not really sure if it works.

What I found: Authenticate a WebAssembly App with the Authenticator Package, so it seems that it is possible. However, you don't need the Zitadel package for it.

from zitadel-net.

KillTrot avatar KillTrot commented on May 30, 2024

Hey @buehler

Thank you very much for you answer.

I was able to find out the problem, but I was not able to find a solution yet.
The class RemoteAuthenticationState expects the state in the token response to contain the property "returnUrl" which is missing with zitadel.
Other providers (KeyCloak, Auth0, Authentik, IdentityServer etc.) provide the returnUrl.
This is why it throws an exception when trying to convert the state to a RemoteAuthenticationState.

Do you think I should open an issue in the zitadel repository?

from zitadel-net.

buehler avatar buehler commented on May 30, 2024

I think this is more of a configuration issue. Do you have a demo-repository?

from zitadel-net.

KillTrot avatar KillTrot commented on May 30, 2024

I quickly created one
Have a look here: https://github.com/KillTrot/Zitadel-BlazorWasm

from zitadel-net.

buehler avatar buehler commented on May 30, 2024

So, I managed to get it working (for the Auth part at least). You need to add the following return Url in ZITADEL to your redirect urls: https://localhost:5443/authentication/login-callback. Afterwards, the login & redirect works. However, after the redirect (when fetching the user profile), the following error appears:

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: An exception occurred executing JS interop: The JSON value could not be converted to Microsoft.AspNetCore.Components.WebAssembly.Authentication.RemoteAuthenticationState.

from zitadel-net.

KillTrot avatar KillTrot commented on May 30, 2024

This is exactly the exception I'm currently fighting with.

I also created an issue on the Zitadel repository: zitadel/zitadel#5783

I think we can close this here, as it is not related with zitadel-net

from zitadel-net.

buehler avatar buehler commented on May 30, 2024

Alright :) I think overwriting the default remote state object could be a good idea. My guess is, that in the OIDC Spec, the state is an arbitrary field and not necessarily an object with the return url.

from zitadel-net.

KillTrot avatar KillTrot commented on May 30, 2024

Thanks very much for your invested time :)

from zitadel-net.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.