Comments (3)
Interesting. It looks like MSAL's HttpClient isn't compatible with WASM. Luckely you can provide your own
https://learn.microsoft.com/en-us/entra/msal/dotnet/advanced/httpclient#example-implementation
from microsoft-authentication-library-for-dotnet.
Blazor WASM is a web app framework, no? So you should use ConfidentialClientApplication.
See Public client and confidential client applications for differences between two types.
There's a Blazor WASM sample here that uses MSAL JavaScript and a Blazor Server sample here which actually uses Microsoft.Identity.Web - an simplified abstraction over MSAL.NET (recommended).
from microsoft-authentication-library-for-dotnet.
I didn't ask for explanation what Blazor WASM is and have already implemented the "right" MSAL solution using MSAL.js and MS Graph. But there are problems with it and I wanted to have full control over authentication like I have with PublicClientApplication in e.g. WPF or Web.API. I don't want to have some additional stuff done with Cookies, Session Storage etc. behind me. PublicClientApplication gives me the possibility for the same process with same sign-in dialog and all the things it offers but finally returning a response with which I can do what I want. You can also see that WPF is in first group and Web.API (confidential app) in the second one and in both cases I could test a PoC with PublicClientApplication so I don't know what you were going to point me out. I don't need to go into security details here.
I'd no like to explain all the details from the current implementation as it will take too much time, but logging-out and leaving "trash" somewhere makes my application working incorrectly for personal accounts especially after logging out. Generally using RemoteAuthenticatorView and AddAccountClaimsPrincipalFactory is what I'd like to avoid and that's the reason why I tried to implement something what just returns me a log-in result with which I can do whatever I want within the AuthenticationStateProvider.
The provided solution https://github.com/Azure-Samples/ms-identity-blazor-wasm/tree/main/WebApp-graph-user/Call-MSGraph seems to be a tricky one for me and will not solve the problems I have.
My solution would be almost fine unless
await graphClient.Me.RevokeSignInSessions.PostAsRevokeSignInSessionsPostResponseAsync();
worked for all account types including personal accounts. Unfortunately, clean log out works only for work accounts.
https://learn.microsoft.com/en-us/graph/api/user-revokesigninsessions?view=graph-rest-1.0&tabs=http
from microsoft-authentication-library-for-dotnet.
Related Issues (20)
- [Feature Request] Remove UWP targets HOT 2
- [Feature Request] Reduce risk of oauth token compromise by storing tokens in $XDG_RUNTIME_DIR HOT 1
- [Bug] Login problems points to no internet connection HOT 2
- [Bug] Unable to build in release configuration since version 4.52 for .Net 4.8
- [Bug] Force Login Prompt doesn't work with Custom B2C Policy HOT 2
- [Bug] PublicClientApplicationBuilder does not work with redirecturi other than localhost HOT 6
- [Bug] Service Accounts that are exempt of doing MFA, fail to authenticate using WAM HOT 3
- [Bug] "Back" button appears in MSAL.net (which was not appearing in ADAL.net) HOT 7
- Issue with Single Sign-On (SSO) Implementation in WPF Application HOT 6
- [Bug] Issue with Single Sign-On (SSO) Implementation HOT 1
- [Bug] UWP Hololens application stopped getting past entering email and shows a blank UI HOT 3
- [Engineering task] Enable PPE Tests when labs is ready
- [Engineering task] Need an API for Managed Identity to detect the current environment
- [Engineering task] Support logical URLs HOT 2
- [Documentation]
- [Feature Request] Allow POP extensibility API on all requests
- [Bug] "cannot convert from 'Microsoft.Identity.Client.BrokerOptions' to 'bool'" error when update Microsoft.Identity.Client.Broker to version 4.61.0 HOT 6
- [Epic] Use open telemetry data to see errors and performance
- Add more tags to open telemetry failure counter
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 microsoft-authentication-library-for-dotnet.