Cannot add Azure B2C authentication to Asp.Net WebForms application

Dmitriy Reznik 206 Reputation points

I have an Asp.Net 4.7 WebForms legacy application written in Currently it uses Microsoft.AspNet.Identity for authentication. But we need to switch to Azure B2C authentication. I tried to follow various instructions I could find, e.g., but nothing works for me. I cannot even compile the application. Is it even doable for a application?

I created everything needed in Azure, so I have what to add to web.config:

 <!-- Azure AD B2C Settings -->  
 <add key="ida:Tenant" value="" />  
 <add key="ida:ClientId" value="7jg87k77-a45i-9o7d-n123-jggr2y7il777" />  
 <add key="ida:AadInstance" value="{0}/v2.0/.well-known/openid-configuration?p={1}" />  
 <add key="ida:RedirectUri" value="https://localhost:44316/signin-oidc" />  
 <!--<add key="ida:SignUpPolicyId" value="<<signup-policy-name>>" />-->  
 <add key="ida:SignInPolicyId" value="B2C_1_signin" />  
 <!--<add key="ida:UserProfilePolicyId" value="<<editprofile-policy-name>>" />-->  
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
1,830 questions
ASP.NET Web Forms
ASP.NET Web Forms
A part of the ASP.NET web application framework that can be used to create ASP.NET web applications.
402 questions
Azure Active Directory External Identities
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alfredo Revilla (MSFT) 15,886 Reputation points Microsoft Employee

    Hello @Dmitriy Reznik , the github sample works fine. It should work with VB.NET too. If it does not compile, then you need to check for errors on the Visual Studio Error List or MS Build ouput. Finally, replace with https://<B2C TENANT>

    Let us know if this answer was helpful to you or if you need additional assistance. If it was helpful, please remember to accept it so that others in the community with similar questions can more easily find a solution.