Azure-Samples / active-directory-aspnetcore-webapp-openidconnect-v2

An ASP.NET Core Web App which lets sign-in users (including in your org, many orgs, orgs + personal accounts, sovereign clouds) and call Web APIs (including Microsoft Graph)
MIT License
1.37k stars 983 forks source link

Configure.sp1 #749

Open jodyford-msft opened 8 months ago

jodyford-msft commented 8 months ago

Microsoft.Identity.Web version

2.13.0

Web app sign-in

1-WebApp-OIDC/1-1-MyOrg

Web API (call Graph or downstream APIs)

2-WebApp-graph-user/2-1-Call-MSGraph

Deploy to Azure

5-WebApp-AuthZ/5-1-Roles

Auth Z

6-Deploy-to-Azure

Description

This script requires admin access on azure to work correctly.

Reproduction steps

Step 1. Insert mIcrosoft's tenet id where required. Step 2. run ./configure.ps1 on powershell as administrator.

Error message

No response

Id Web logs

No response

Relevant code snippets

1. Run the script to create your Azure AD application and configure the code of the sample application accordingly.

   cd .\AppCreationScripts\
   .\Configure.ps1 -TenantId "[tenet id here]"

----response after authenticating into aad Need admin approval unverified
needs permission to access resources in your organization that only an admin can grant. Please ask an admin to grant permission to this app before you can use it.

Regression

No response

WARNING: An error occurred when writing to a listener. Unable to register apps. Error is An error occurred when writing to a listener.. Disconnecting from tenant Disconnect-MgGraph : No application to sign out from. At C:\Users\azureuser\source\repos\active-directory-aspnetcore-webapp-openidconnect-v2\4-WebApp-your-API\4-1-MyOrg\AppCreationScripts\Configur e.ps1:499 char:1 + Disconnect-MgGraph + ~~~~~~ + CategoryInfo : CloseError: (:) [Disconnect-MgGraph], ArgumentException + FullyQualifiedErrorId : Microsoft.Graph.PowerShell.Authentication.Cmdlets.DisconnectMgGraph

Expected behavior

I expect the code to work correctly and create the appropriate permissions. without running this script, the sample does not work