active-directory-b2c-dotnet-desktop | Sample showing how a Windows desktop | Azure library
kandi X-RAY | active-directory-b2c-dotnet-desktop Summary
kandi X-RAY | active-directory-b2c-dotnet-desktop Summary
Sample showing how a Windows desktop .NET (WPF) application can sign in a user using Azure AD B2C, get an access token using MSAL.NET and call an API.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of active-directory-b2c-dotnet-desktop
active-directory-b2c-dotnet-desktop Key Features
active-directory-b2c-dotnet-desktop Examples and Code Snippets
cd ..
git clone https://github.com/Azure-Samples/active-directory-b2c-javascript-nodejs-webapi.git
var tenantID = ".onmicrosoft.com";
var clientID = "";
var policyName = "";
npm install && npm update
node index.js
git clone https://github.com/Azure-Samples/active-directory-b2c-dotnet-desktop.git
Community Discussions
Trending Discussions on active-directory-b2c-dotnet-desktop
QUESTION
I Have created an native app (WPF) where the authentication system is based on Azure AD B2C. I have been following the documentation here:
Configure authentication in a sample WPF
And everything works...
But when I create an executable file and install it on another machine the errors begin.
Here is the error message:
...ANSWER
Answered 2022-Feb-15 at 15:31I had the same problem and managed to fix it: The reason was the cache file which is used, it gives problems if the cache file of another User/PC is read. So in the TokenCacheHelper
I do set the username in the filename.
Example:
QUESTION
User Story: Given an ADB2C User, with Global Administrator role and an oid of 01234567-901a-bcde-f012-3456789abcde
(not a real oid), I want to be able to log in as that user and retrieve the user profile from "https://graph.microsoft.com/beta/me" or "https://graph.microsoft.com/beta/users/01234567-901a-bcde-f012-3456789abcde". Both are listed in the documentation as valid endpoints for B2C.
In an app registration with only Microsoft Graph permission scopes assigned, I used postman to request a bearer token for access to MS Graph. There is one Web redirect URI (https://oauth.pstmn.io/v1/callback), one client secret, and implicit grant is on for both access and id tokens.
The scopes requested are: openid offline_access https://graph.microsoft.com/Directory.AccessAsUser.All
Again, the B2C user account has the Global Administrator role.
- The Implicit flow returns the error message
AADB2C90205: This application does not have sufficient permissions against this web resource to perform the operation.
- The Authorization Code flow, when the app secret is included, lacks an access bearer token. There is an ID token and a refresh token, but no access token. That's with and without PKCE, whether or not I send the authorization to an external browser.
The app in my tenant has a user flow, B2C_1_postman
, which is basically default. It works just fine with postman, other test apps, and the "Run User Flow" function in the B2C management blade.
The auth endpoint is:
...ANSWER
Answered 2020-Jun-10 at 05:59Managing users through Graph API still seems to require usage of application permissions. So instead of adding delegated permissions to the app in B2C, you need to add application permissions, where you call the Graph API as the app, not on behalf of the user. The instructions in the docs explain the app registration in detail: https://docs.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-get-started
You need to give this app application permissions to Graph API, not delegated permissions. Then use those app credentials purely to call Graph API. And you need to use the underlying Azure AD's token endpoint instead of your B2C policy token endpoint.
Since your app is a desktop app (a public client app), you'll need to do the Graph API interactions in a back-end service to which you can authenticate with a B2C token acquired on behalf of the user.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install active-directory-b2c-dotnet-desktop
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page