Questions tagged [microsoft-identity-web]

111 questions
1
vote
1 answer

Getting 401 from custom Api when using Microsoft.Identity.platform to protect api

I am following the tutorial from Microsfot.document for how to protect api using Azure AD (Microsoft Identity). The steps I took are following: Sorry I tried to put information that might be helpful but too much to get to the issue most of the time…
1
vote
0 answers

Is there any way to specify the redirect URL, when using an alias

My website (.NET Core 3.1) is using an alias, dictated by company policy, to hide the internal server address from the outside world. But because of this, the signin fails, because the Identity code is picking up the real server name and sending…
creohornet
  • 81
  • 1
  • 6
1
vote
1 answer

Microsoft Identity Web : Azure AD Client Credential flow with Certificate Based Authentication

I am connecting to Graph API with Microsoft Identity Web (MSAL) library. [https://github.com/AzureAD/microsoft-identity-web][1] For this I am using client credentials flow with certificate based authentication. My configurations are below Service…
1
vote
0 answers

How to use Refresh Token with ASP.NET Core 6 MVC and Azure AD Microsoft.Identity.Web?

What else do I need to program so that my web app responds to a refresh token? I access the Azure-AD via Powershell and execute this command Revoke-AzureADUserAllRefreshToken -ObjectId "ONJECTID". Now, since I have 2 web apps and an already logged…
1
vote
1 answer

How to add new role to existing Microsoft Identity User from MVC C# Controller using .net5

I have a application where the user is being logged in using the Azure AD with the details then stored in the database. Now if the user exists in the database they are allocated a role. This role is added to the claims in the startup.cs, which is…
1
vote
0 answers

Microsoft.Identity.Web inside an Azure function

I need to call a downstream API, i.e., PowerBI Service, from inside my Azure Function. I have a working example inside a web app but I am not able to make it happen inside my Azure Function. In the web app sample, the configuration happens via…
1
vote
1 answer

ASP.NET Core 5: OpenIDConnect breaking default/root route

I have an ASP.NET Core 5 MVC app, with the default/root route set like this inside PageController: [AllowAnonymous] [Route("/")] public IActionResult __Home(int? parent) { return View(); } This worked fine until I added OpenIdConnect…
1
vote
1 answer

MicrosoftIdentityWebApi Not Working for Web Application when Added in Startup

I'm adding this question because I struggled for a while to find this and wanted to add a reference here for anyone pulling their hair out over the same issue. While hooking up Azure B2C I struggled trying to get the backend to be able to read the…
1
vote
0 answers

Microsoft.Web.Identity nuget >=1.9.2 breaks AppService/Azure AD login with 401 response

Testing with a plain vanilla (out of the box sample asp.net 5 MVC web app from VS2019), hosted on an Azure app service (backed with a linux app service plan). Nothing changed or added, except adding an [Authorize] tag to test against a single view…
1
vote
0 answers

When using DefaultAzureCredential, web app tries to use ManagedIdentityCredential on local computer

I'm using DefaulAzureCredential (Azure.Identity v1.2.3), to access resources on Azure. In Program.cs of my Asp.Net Core 3.1 web app, I configured Azure key vault access like below: public static void Main(string[] args) { …
synergetic
  • 7,756
  • 8
  • 65
  • 106
1
vote
1 answer

Capture Events From Microsoft.Identity.Web Login/Logout

I am using Microsoft's Authentication/Authorization platform to allow User Sign-ins from Azure AD. I would like to log these events into a database. Issue is, since this type of authentication leverages middleware I am not sure how to inject code to…
1
vote
1 answer

MSAL4j - How to handle MsalThrottlingException?

I use MSAL4j and there is an exception type named MsalThrottlingException. How can I handle it when I catch it? I need an example implementation. try{ Future future = …
1
vote
1 answer

Azure AD B2C & Microsoft Identity Web - Sign In with multiple policies (.net Core 3.1)

I have an application using .NET Core 3.1 MVC Web App that uses Azure AD B2C to sign in users and I've just migrated it to use Microsoft Identity Web library. We want to have two different policies for Sign In, one for regular users…
1
vote
3 answers

EntityFramework Core automatic migration

In my project I have 2 databases: one is my custom database and the other one is ApplicationDbContext that Microsoft Identity gives me. In my Startup.cs I have this code: public void Configure(IApplicationBuilder app, IWebHostEnvironment env, …
Enrico
  • 3,592
  • 6
  • 45
  • 102
1
vote
2 answers

ASP.NET Core Microsoft Identity sign out "The scheme field is required."

I'm using ASP.NET Core 5 with Azure AD authentication. I created a new template web app and sign in and sign out with Azure AD work great. But when I copied the relevant code in Startup.cs and appsettings.json from the template web app into another…