Git Product home page Git Product logo

Comments (5)

fwaris avatar fwaris commented on May 23, 2024

@Tarmil the interactive login using MSAL.js (and blazor wrapper) started failing when I moved my .Net 7 app to .Net 8.

The authentication uses Bolero page routing to redirect:

match model.page with 
| Page.Authentication action -> 
    ecomp<LoginRedirectView,_,_> (action,model) dispatch {attr.empty()}
| Page.Home -> 
    ...

Where ecomp<LoginRedirectView...> uses the RemoteAuthenticatorView (from "Microsoft.Authentication.WebAssembly.Msal" package that handles the actual callback.

So far, I have not been able to fix this issue. I am wondering if it could be related to what you have described here related to render modes?

from bolero.

Tarmil avatar Tarmil commented on May 23, 2024

@fwaris I wouldn't expect existing code to break due to this; interactive render modes are a new alternate way of managing rendering, but existing ones are still valid.

As a sanity check, did you also upgrade Microsoft.Authentication.WebAssembly.Msal (and even all your Microsoft.* dependencies) to v8.0.0? I wouldn't be surprised if that is necessary.

from bolero.

fwaris avatar fwaris commented on May 23, 2024

@Tarmil, after some investigation I discovered a few things.

The MSAL authentication fails only when the app is deployed to Azure app service (only this mode tested) - AND prerendered=true.

(Locally, all is fine (debug/release ; .Net 7/8; prerendered=true/false)

The Azure app starts to work fine if I set prerendered=false.

The F#/Bolero app has both client and server sides. I modeled the authentication configuration after the C# example below.

The C# example works fine when deployed to Azure. I created it from this MS article, as follows:

dotnet new blazorwasm -au SingleOrg --client-id "{CLIENT ID}" -o {PROJECT NAME} --tenant-id "{TENANT ID}"

(The repo is here: https://github.com/fwaris/BlzHstdAuth)

I am not sure if in C# RemoteAuthenticatorView is actually being rendered just on the client (and so is equivalent to prerendered=false in F#).

The C# has both client-side and server-side authentication configurations (in respective appSettings.json files). Both are being used somehow.

With prerendered=true (and deployed to Azure) causes some type of javascript error on the msal.js UI. This happens right at the end when the callback with token has been received.

from bolero.

Tarmil avatar Tarmil commented on May 23, 2024

@fwaris Yes, the C# version uses an index.html which means it doesn't have prerendering. So I guess if disabling prerendering is acceptable for you then that's the solution.

from bolero.

fwaris avatar fwaris commented on May 23, 2024

got it. thanks. yes not having prerendering is fine in my case

from bolero.

Related Issues (20)

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.