Comments (5)
@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.
@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.
@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.
@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.
got it. thanks. yes not having prerendering is fine in my case
from bolero.
Related Issues (20)
- External JS scripts do not work inside the Bolero "program" HOT 2
- After Upgrading to to 0.23: WebAssembly error - Unhandled exception rendering component: Cannot read properties of null (reading 'insertBefore') HOT 15
- Upgrading to .net 8.0 client wasm hosted project, compiler errors: failing 'open Bolero.Html' HOT 6
- HTML templates autocomplete
- Update v0.23 dependencies to .NET 8 RTM HOT 1
- Scoped CSS not working with HTML templates HOT 2
- [Hot reload] of HTML pages does not work if you start client only HOT 1
- Trigger CSS recompilation for C# razor project HOT 3
- [CSS isolation] attributes do not apply to components generated in code HOT 3
- Custom Bolero node HOT 3
- Add Server-project retroactively? HOT 1
- [`OnParametersSet`] happens after `OnInitalized` if navigation happens through `NavigationManager` HOT 2
- Preserve focus between fields change
- Web worker with F# HOT 3
- Hot reload causing template to drop class attribute HOT 1
- Bolero ignores ASPNETCORE_HTTP_PORTS environment variable HOT 2
- Slow rendering HOT 2
- Is Bolero capable of integrating with MAUI thru BlazorWebView?
- CSS isolation does not work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bolero.