Search code examples
asp.net.netvb.netvisual-studioasp.net-identity

Error signing up a VB.net web forms project to Microsoft identity platform


I wanted to make an vb.net web forms project, and when selecting to have the Microsoft identity authentication, it throws this error which is preventing me from registering. Im confused on this error, because when I create a C# web forms application it allows me to run through the registration process for a new app just fine.

error shown from the app registration process

I have tried adding a product description to the web forms application settings, however this still throws the same error, and I have tried adding a description to the project on the command line, and running the commands help methods and looking at the documentation for the command line tool, but I have not yet found anything that would help me out.


Solution

  • After trying to get this to work all day(not really) I ultimately found a really simple solution to what I believe to be a Visual Studio IDE bug.

    I had to sign up my app (finding the link on this page https://apps.dev.microsoft.com/#/appList) manually, and then copying the tenant and client id values out of the overview essentials menu.

    I then copied the application config section out of the c# web.config and pasted into the outermost configuration tag for the vb application. The output is in the following code block:

    <appSettings>
       <add key="ida:ClientId" value="clientIDCopiedFromAzurePortal" />
       <add key="ida:AADInstance" value="https://login.microsoftonline.com/" />
       <add key="ida:Domain" value="diehlmitchellgmail.onmicrosoft.com" />
       <add key="ida:TenantId" value="tenantIDCopiedFromAzurePortal" />
       <add key="ida:PostLogoutRedirectUri" value="https://localhost:44304/signin-oidc" />
    </appSettings>
    

    This should allow the app to work and allows me to sign in without issue