├── 1-WebApp-OIDC ├── 1-5-B2C │ ├── Placeholder.txt │ ├── wwwroot │ │ ├── js │ │ │ ├── site.min.js │ │ │ └── site.js │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ ├── package.json │ │ │ │ └── dist │ │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ └── js │ │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE.txt │ │ │ └── jquery │ │ │ │ └── .bower.json │ │ ├── favicon.ico │ │ └── css │ │ │ ├── site.min.css │ │ │ └── site.css │ ├── .gitignore │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Claims.cshtml │ │ │ └── Index.cshtml │ │ └── Shared │ │ │ └── Error.cshtml │ ├── Properties │ │ ├── serviceDependencies.json │ │ ├── serviceDependencies.local.json │ │ └── launchSettings.json │ ├── ReadmeFiles │ │ ├── sign-in.png │ │ └── v2-variations.png │ ├── appsettings.Development.json │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── appsettings.json │ ├── Controllers │ │ └── HomeController.cs │ └── WebApp-OpenIDConnect-DotNet.csproj └── 1-1-MyOrg │ ├── .gitignore │ ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ ├── Privacy.cshtml │ │ └── Index.cshtml │ └── Shared │ │ ├── _ValidationScriptsPartial.cshtml │ │ ├── _LoginPartial.cshtml │ │ └── Error.cshtml │ ├── Properties │ ├── serviceDependencies.json │ ├── serviceDependencies.local.json │ └── launchSettings.json │ ├── wwwroot │ ├── lib │ │ ├── bootstrap │ │ │ └── package.json │ │ └── jquery-validation-unobtrusive │ │ │ └── LICENSE.txt │ ├── favicon.ico │ └── js │ │ └── site.js │ ├── ReadmeFiles │ ├── sign-in.png │ └── v2-variations.png │ ├── appsettings.Development.json │ ├── Models │ └── ErrorViewModel.cs │ ├── Program.cs │ └── WebApp-OpenIDConnect-DotNet.csproj ├── 3-WebApp-multi-APIs ├── wwwroot │ ├── js │ │ ├── site.min.js │ │ └── site.js │ ├── lib │ │ ├── bootstrap │ │ │ ├── package.json │ │ │ └── dist │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ └── LICENSE.txt │ │ └── jquery │ │ │ └── .bower.json │ ├── favicon.ico │ └── css │ │ ├── site.min.css │ │ └── site.css ├── Views │ ├── _ViewStart.cshtml │ ├── Home │ │ ├── Blob.cshtml │ │ ├── Privacy.cshtml │ │ ├── Index.cshtml │ │ └── Tenants.cshtml │ ├── _ViewImports.cshtml │ └── Shared │ │ ├── _LoginPartial.cshtml │ │ └── Error.cshtml ├── Properties │ ├── serviceDependencies.json │ ├── serviceDependencies.local.json │ └── launchSettings.json ├── ReadmeFiles │ └── architecture.png ├── appsettings.Development.json ├── Services │ ├── MicrosoftGraph-Rest │ │ ├── WebOptions.cs │ │ ├── IGraphApiOperations.cs │ │ └── Bootstrapper.cs │ └── ARM │ │ ├── IArmOperations.cs │ │ ├── IArmOperationsWithImplicitAuth.cs │ │ └── ArmSimplifiedDataModel.cs ├── Models │ └── ErrorViewModel.cs ├── Infrastructure │ └── Constants.cs └── Program.cs ├── 5-WebApp-AuthZ ├── 5-1-Roles │ ├── wwwroot │ │ ├── js │ │ │ ├── site.min.js │ │ │ └── site.js │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ ├── package.json │ │ │ │ └── dist │ │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ └── js │ │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE.txt │ │ │ └── jquery │ │ │ │ └── .bower.json │ │ ├── favicon.ico │ │ ├── images │ │ │ ├── GetApplications.png │ │ │ └── Sign-in-Consent.png │ │ └── css │ │ │ ├── site.min.css │ │ │ └── site.css │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── Users.cshtml │ │ ├── Account │ │ │ └── AccessDenied.cshtml │ │ └── Shared │ │ │ ├── _LoginPartial.cshtml │ │ │ └── Error.cshtml │ ├── Properties │ │ ├── serviceDependencies.json │ │ ├── serviceDependencies.local.json │ │ └── launchSettings.json │ ├── ReadmeFiles │ │ ├── topology.png │ │ ├── Sign-in-Consent.png │ │ └── v2-variations.png │ ├── appsettings.Development.json │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Infrastructure │ │ ├── GraphScopes.cs │ │ └── Constants.cs │ ├── Program.cs │ └── WebApp-OpenIDConnect-DotNet.csproj └── 5-2-Groups │ ├── wwwroot │ ├── js │ │ ├── site.min.js │ │ └── site.js │ ├── lib │ │ ├── bootstrap │ │ │ ├── package.json │ │ │ └── dist │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ └── LICENSE.txt │ │ └── jquery │ │ │ └── .bower.json │ ├── favicon.ico │ ├── images │ │ └── CallGroups.png │ └── css │ │ ├── site.min.css │ │ └── site.css │ ├── .gitignore │ ├── Views │ ├── _ViewStart.cshtml │ ├── Home │ │ └── Privacy.cshtml │ ├── _ViewImports.cshtml │ ├── Admin │ │ └── Index.cshtml │ └── Shared │ │ ├── _LoginPartial.cshtml │ │ └── Error.cshtml │ ├── Properties │ ├── serviceDependencies.json │ ├── serviceDependencies.local.json │ └── launchSettings.json │ ├── ReadmeFiles │ ├── topology.png │ └── v2-variations.png │ ├── appsettings.Development.json │ ├── Models │ └── ErrorViewModel.cs │ ├── Infrastructure │ ├── Constants.cs │ ├── AuthorizationPolicies.cs │ └── CacheSettings.cs │ ├── Controllers │ ├── AccountController.cs │ ├── HomeController.cs │ └── AdminController.cs │ └── Program.cs ├── 4-WebApp-your-API ├── 4-1-MyOrg │ ├── Client │ │ ├── wwwroot │ │ │ ├── js │ │ │ │ ├── site.min.js │ │ │ │ └── site.js │ │ │ ├── lib │ │ │ │ ├── bootstrap │ │ │ │ │ ├── package.json │ │ │ │ │ └── dist │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ │ └── js │ │ │ │ │ │ └── npm.js │ │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ │ ├── .bower.json │ │ │ │ │ └── LICENSE.txt │ │ │ │ └── jquery │ │ │ │ │ └── .bower.json │ │ │ ├── favicon.ico │ │ │ └── css │ │ │ │ ├── site.min.css │ │ │ │ └── site.css │ │ ├── Views │ │ │ ├── _ViewStart.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ ├── Home │ │ │ │ ├── Privacy.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── _LoginPartial.cshtml │ │ │ │ └── Error.cshtml │ │ │ └── TodoList │ │ │ │ ├── Details.cshtml │ │ │ │ └── DeleteItem.cshtml │ │ ├── Properties │ │ │ ├── serviceDependencies.json │ │ │ ├── serviceDependencies.local.json │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ ├── Infrastructure │ │ │ └── Constants.cs │ │ └── Program.cs │ ├── TodoListService │ │ ├── Properties │ │ │ ├── serviceDependencies.json │ │ │ ├── serviceDependencies.local.json │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── Models │ │ │ └── TodoItem.cs │ │ ├── TodoListService.csproj │ │ ├── Program.cs │ │ └── appsettings.json │ └── ReadmeFiles │ │ ├── topology.png │ │ └── ReadmeTroubleshooting.md ├── 4-2-B2C │ ├── Client │ │ ├── wwwroot │ │ │ ├── js │ │ │ │ ├── site.min.js │ │ │ │ └── site.js │ │ │ ├── lib │ │ │ │ ├── bootstrap │ │ │ │ │ ├── package.json │ │ │ │ │ └── dist │ │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ │ └── js │ │ │ │ │ │ └── npm.js │ │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ │ ├── .bower.json │ │ │ │ │ └── LICENSE.txt │ │ │ │ └── jquery │ │ │ │ │ └── .bower.json │ │ │ ├── favicon.ico │ │ │ └── css │ │ │ │ ├── site.min.css │ │ │ │ └── site.css │ │ ├── Views │ │ │ ├── _ViewStart.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ ├── Home │ │ │ │ ├── Privacy.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── TodoList │ │ │ │ ├── Details.cshtml │ │ │ │ ├── Create.cshtml │ │ │ │ └── Delete.cshtml │ │ │ └── Shared │ │ │ │ ├── _LoginPartial.cshtml │ │ │ │ └── Error.cshtml │ │ ├── Properties │ │ │ ├── serviceDependencies.json │ │ │ ├── serviceDependencies.local.json │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ └── Program.cs │ ├── TodoListService │ │ ├── Properties │ │ │ ├── serviceDependencies.json │ │ │ ├── serviceDependencies.local.json │ │ │ └── launchSettings.json │ │ ├── appsettings.Development.json │ │ ├── Models │ │ │ └── TodoItem.cs │ │ ├── TodoListService.csproj │ │ ├── appsettings.json │ │ └── Program.cs │ └── ReadmeFiles │ │ └── topology.png └── 4-3-AnyOrg │ ├── ToDoListClient │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ ├── _LoginPartial.cshtml │ │ │ └── Error.cshtml │ │ └── ToDoList │ │ │ └── Delete.cshtml │ ├── wwwroot │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ └── package.json │ │ │ └── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ ├── favicon.ico │ │ └── js │ │ │ └── site.js │ ├── appsettings.Development.json │ ├── Models │ │ ├── ErrorViewModel.cs │ │ └── ToDoItem.cs │ ├── Utils │ │ └── WebApiMsalUiRequiredException.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Services │ │ └── IToDoListService.cs │ ├── ToDoListClient.csproj │ └── Program.cs │ ├── ReadmeFiles │ ├── topology.png │ ├── AdminConsentBtn.png │ ├── Home_Tenant_SP.png │ ├── admin_consent_api.png │ ├── admin_consent_app.png │ ├── admin_redirect_api.png │ ├── admin_redirect_app.png │ └── Home_Tenant_SP_Delete.png │ └── TodoListService │ ├── appsettings.Development.json │ ├── Models │ ├── TodoContext.cs │ └── TodoItem.cs │ ├── Extensions │ └── QueriesExtensions.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ └── appsettings.json ├── 2-WebApp-graph-user ├── 2-6-BFF-Proxy │ ├── ClientApp │ │ ├── .env │ │ ├── .env.development │ │ ├── public │ │ │ ├── favicon.ico │ │ │ └── manifest.json │ │ ├── src │ │ │ ├── custom.css │ │ │ ├── components │ │ │ │ ├── NavMenu.css │ │ │ │ └── Layout.js │ │ │ ├── reportWebVitals.js │ │ │ ├── App.test.js │ │ │ ├── setupProxy.js │ │ │ └── App.js │ │ └── .gitignore │ ├── Pages │ │ ├── _ViewImports.cshtml │ │ ├── Error.cshtml.cs │ │ └── Error.cshtml │ ├── ReadmeFiles │ │ ├── sequence.png │ │ └── screenshot.png │ ├── appsettings.Development.json │ └── Properties │ │ └── launchSettings.json ├── 2-1-Call-MSGraph │ ├── .gitignore │ ├── ReadmeFiles │ │ ├── AboutTheCode.md │ │ ├── sign-in.png │ │ ├── v2-variations.png │ │ └── Overview.md │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── Index.cshtml │ │ └── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ ├── _LoginPartial.cshtml │ │ │ └── Error.cshtml │ ├── wwwroot │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ └── package.json │ │ │ └── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ ├── favicon.ico │ │ └── js │ │ │ └── site.js │ ├── appsettings.Development.json │ ├── Models │ │ └── ErrorViewModel.cs │ ├── WebApp-OpenIDConnect-DotNet-graph.csproj │ ├── Program.cs │ └── Properties │ │ └── launchSettings.json ├── 2-2-TokenCache │ ├── .gitignore │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── Index.cshtml │ │ └── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ ├── _LoginPartial.cshtml │ │ │ └── Error.cshtml │ ├── Properties │ │ ├── serviceDependencies.json │ │ ├── serviceDependencies.local.json │ │ └── launchSettings.json │ ├── wwwroot │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ └── package.json │ │ │ └── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ ├── favicon.ico │ │ └── js │ │ │ └── site.js │ ├── ReadmeFiles │ │ ├── sign-in.png │ │ └── v2-variations.png │ ├── appsettings.Development.json │ ├── Models │ │ └── ErrorViewModel.cs │ └── Program.cs ├── 2-3-Multi-Tenant │ ├── .gitignore │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── UnauthorizedTenant.cshtml │ │ └── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ ├── Error.cshtml │ │ │ └── _LoginPartial.cshtml │ ├── wwwroot │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ └── package.json │ │ │ └── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ ├── favicon.ico │ │ └── js │ │ │ └── site.js │ ├── ReadmeFiles │ │ ├── Sign-in.png │ │ ├── topology.png │ │ ├── todo-edit.png │ │ ├── v2-variations.png │ │ ├── admin-approval.png │ │ └── unauthorized-tenant.png │ ├── Utils │ │ └── GraphScope.cs │ ├── appsettings.Development.json │ ├── Models │ │ ├── ErrorViewModel.cs │ │ └── TodoItem.cs │ ├── DAL │ │ └── SampleDbContext.cs │ └── Properties │ │ └── launchSettings.json ├── 2-4-Sovereign-Call-MSGraph │ ├── .gitignore │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── Index.cshtml │ │ └── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ ├── _LoginPartial.cshtml │ │ │ └── Error.cshtml │ ├── wwwroot │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ └── package.json │ │ │ └── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ ├── favicon.ico │ │ └── js │ │ │ └── site.js │ ├── ReadmeFiles │ │ ├── sign-in.png │ │ └── v2-variations.png │ ├── appsettings.Development.json │ ├── Models │ │ └── ErrorViewModel.cs │ ├── Program.cs │ └── Properties │ │ └── launchSettings.json └── 2-5-HybridFlow │ ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ └── Privacy.cshtml │ └── Shared │ │ ├── _ValidationScriptsPartial.cshtml │ │ └── Error.cshtml │ ├── wwwroot │ ├── favicon.ico │ ├── css │ │ └── site.css │ └── lib │ │ └── jquery-validation-unobtrusive │ │ └── LICENSE.txt │ ├── ReadmeFiles │ ├── topology.png │ ├── ReadmeTroubleshooting.md │ ├── ReadmeNextSteps.md │ ├── ReadmeContributing.md │ └── ReadmePrerequirements.md │ ├── appsettings.Development.json │ ├── Models │ └── ErrorViewModel.cs │ ├── 2-5-HybridFlow.csproj │ └── Properties │ └── launchSettings.json ├── UiTests ├── PlaywrightTraces │ └── .gitignore ├── AnyOrgOrPersonalUiTest │ └── appsettings.json └── HybridFlowUiTest │ └── appsettings.json ├── ReadmeFiles ├── sign-in-audiences.png ├── screenshot-overview.png ├── screenshot-authentication.png ├── screenshot-register-app.png └── screenshot-new-registration.png ├── CHANGELOG.md └── .github ├── CODE_OF_CONDUCT.md ├── ISSUE_TEMPLATE ├── documentation.md └── feature_request.md ├── dependabot.yml └── workflows └── dotnet.yml /1-WebApp-OIDC/1-5-B2C/Placeholder.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/.env: -------------------------------------------------------------------------------- 1 | BROWSER=none 2 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/AboutTheCode.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/.gitignore: -------------------------------------------------------------------------------- 1 | ./vs 2 | ./obj 3 | ./bin -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/.env.development: -------------------------------------------------------------------------------- 1 | PORT=44495 2 | HTTPS=true 3 | 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /UiTests/PlaywrightTraces/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore all files in this directory, which is needed for PR pipeline test traces 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/Home/Blob.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Blob"; 3 | } 4 | 5 |

@ViewData["Title"]

6 |

@ViewData["Message"]

7 | 8 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /ReadmeFiles/sign-in-audiences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/ReadmeFiles/sign-in-audiences.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ReadmeFiles/screenshot-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/ReadmeFiles/screenshot-overview.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using CallGraphBFF 2 | @namespace CallGraphBFF.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/wwwroot/favicon.ico -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/3-WebApp-multi-APIs/wwwroot/favicon.ico -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ReadmeFiles/screenshot-authentication.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/ReadmeFiles/screenshot-authentication.png -------------------------------------------------------------------------------- /ReadmeFiles/screenshot-register-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/ReadmeFiles/screenshot-register-app.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-1-MyOrg/wwwroot/favicon.ico -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using _2_1_Call_MSGraph 2 | @using _2_1_Call_MSGraph.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using ToDoListClient 2 | @using ToDoListClient.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /ReadmeFiles/screenshot-new-registration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/ReadmeFiles/screenshot-new-registration.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/ReadmeFiles/sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/ReadmeFiles/sign-in.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_MultiTenant_v2 2 | @using WebApp_MultiTenant_v2.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "secrets1": { 4 | "type": "secrets.user" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/wwwroot/lib/bootstrap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "markdown-it": ">=12.3.2", 4 | "shelljs": ">=0.8.5" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/favicon.ico -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/wwwroot/favicon.ico -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/ReadmeFiles/sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-1-MyOrg/ReadmeFiles/sign-in.png -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/ReadmeFiles/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/3-WebApp-multi-APIs/ReadmeFiles/architecture.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-2-B2C/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-1-MyOrg/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-1-MyOrg/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-2-B2C/Client/wwwroot/favicon.ico -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-1-Call-MSGraph/wwwroot/favicon.ico -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-2-TokenCache/wwwroot/favicon.ico -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/wwwroot/favicon.ico -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-5-HybridFlow/wwwroot/favicon.ico -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/favicon.ico -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/ReadmeFiles/Sign-in-Consent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/ReadmeFiles/Sign-in-Consent.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/images/CallGroups.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/wwwroot/images/CallGroups.png -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [project-title] Changelog 2 | 3 | 4 | # x.y.z (yyyy-mm-dd) 5 | 6 | *Features* 7 | * ... 8 | 9 | *Bug Fixes* 10 | * ... 11 | 12 | *Breaking Changes* 13 | * ... 14 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/ReadmeFiles/sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-2-TokenCache/ReadmeFiles/sign-in.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ReadmeFiles/sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-6-BFF-Proxy/ReadmeFiles/sequence.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/sign-in.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet_graph 2 | @using WebApp_OpenIDConnect_DotNet_graph.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/Sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/Sign-in.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/ReadmeFiles/topology.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-5-HybridFlow/ReadmeFiles/topology.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ReadmeFiles/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-6-BFF-Proxy/ReadmeFiles/screenshot.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/AdminConsentBtn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/AdminConsentBtn.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/Home_Tenant_SP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/Home_Tenant_SP.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/images/GetApplications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/images/GetApplications.png -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/images/Sign-in-Consent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/images/Sign-in-Consent.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/todo-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/todo-edit.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/public/favicon.ico -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_consent_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_consent_api.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_consent_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_consent_app.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_redirect_api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_redirect_api.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_redirect_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/admin_redirect_app.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/wwwroot/favicon.ico -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-2-TokenCache/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Utils/GraphScope.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_MultiTenant_v2.Utils 2 | { 3 | public static class GraphScope 4 | { 5 | public const string UserReadAll = "User.Read.All"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/wwwroot/favicon.ico -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/Home_Tenant_SP_Delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-3-AnyOrg/ReadmeFiles/Home_Tenant_SP_Delete.png -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/admin-approval.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/admin-approval.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp_OpenIDConnect_DotNet 2 | @using WebApp_OpenIDConnect_DotNet.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | @using Microsoft.Extensions.Configuration -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/ReadmeFiles/sign-in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/ReadmeFiles/sign-in.png -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Services/MicrosoftGraph-Rest/WebOptions.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Services.GraphOperations 2 | { 3 | public class WebOptions 4 | { 5 | public string GraphApiUrl { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/unauthorized-tenant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-3-Multi-Tenant/ReadmeFiles/unauthorized-tenant.png -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/ReadmeFiles/v2-variations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/ReadmeFiles/v2-variations.png -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "DetailedErrors": true, 3 | "Logging": { 4 | "LogLevel": { 5 | "Default": "Information", 6 | "Microsoft.AspNetCore": "Warning" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_MultiTenant_v2.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Infrastructure/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | { 3 | public static class Constants 4 | { 5 | public const string ScopeUserRead = "User.Read"; 6 | public const string BearerAuthorizationScheme = "Bearer"; 7 | } 8 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/HEAD/4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace ToDoListClient.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/custom.css: -------------------------------------------------------------------------------- 1 | /* Provide sufficient contrast against white background */ 2 | a { 3 | color: #0366d6; 4 | } 5 | 6 | code { 7 | color: #E01A76; 8 | } 9 | 10 | .btn-primary { 11 | color: #fff; 12 | background-color: #1b6ec2; 13 | border-color: #1861ac; 14 | } 15 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.AspNetCore.SpaProxy": "Information", 7 | "Microsoft.Hosting.Lifetime": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Infrastructure/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | { 3 | public static class Constants 4 | { 5 | public const string ScopeUserImpersonation = "user_impersonation"; 6 | public const string BearerAuthorizationScheme = "Bearer"; 7 | } 8 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace _2_1_Call_MSGraph.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Services/ARM/IArmOperations.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet.Services.Arm 5 | { 6 | public interface IArmOperations 7 | { 8 | Task> EnumerateTenantsIdsAccessibleByUser(string accessToken); 9 | } 10 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebApp_OpenIDConnect_DotNet_graph.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Services/ARM/IArmOperationsWithImplicitAuth.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet.Services.Arm 5 | { 6 | public interface IArmOperationsWithImplicitAuth 7 | { 8 | Task> EnumerateTenantsIds(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Views/Admin/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Admin Page"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

8 | 9 |

10 |

11 | This page is a placeholder meant to show how you can further restrict pages to members of certain groups such as admin groups. 12 |

13 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Infrastructure/GraphScopes.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | 3 | { 4 | public static class GraphScopes 5 | { 6 | public const string UserRead = "User.Read"; 7 | public const string UserReadBasicAll = "User.ReadBasic.All"; 8 | public const string DirectoryReadAll = "Directory.Read.All"; 9 | } 10 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Infrastructure/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | { 3 | public static class Constants 4 | { 5 | public const string ScopeUserRead = "User.Read"; 6 | 7 | public const string ScopeGroupMemberRead = "GroupMember.Read.All"; 8 | 9 | public const string BearerAuthorizationScheme = "Bearer"; 10 | } 11 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Utils/WebApiMsalUiRequiredException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace ToDoListClient.Utils 7 | { 8 | public class WebApiMsalUiRequiredException:Exception 9 | { 10 | public WebApiMsalUiRequiredException(string message) : base(message) { } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/Models/TodoItem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace TodoListService.Models 7 | { 8 | public class Todo 9 | { 10 | public int Id { get; set; } 11 | 12 | public string Title { get; set; } 13 | 14 | public string Owner { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/Account/AccessDenied.cshtml: -------------------------------------------------------------------------------- 1 | 2 | @{ 3 | ViewData["Title"] = "AccessDenied"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 |

Access Denied

8 | 9 |

You do not have the permission to access this action. Please sign-out and sign-in again with an account that has the roles assigned to access this action.

10 | 11 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/Models/TodoItem.cs: -------------------------------------------------------------------------------- 1 | namespace TodoListService.Models 2 | { 3 | /// 4 | /// Data object to transfer information between client/server/database 5 | /// 6 | public class Todo 7 | { 8 | public int Id { get; set; } 9 | 10 | public string Title { get; set; } 11 | 12 | public string Owner { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Models/ToDoItem.cs: -------------------------------------------------------------------------------- 1 | namespace ToDoListClient.Models 2 | { 3 | public class ToDoItem 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Title { get; set; } 8 | 9 | public string AssignedTo { get; set; } 10 | 11 | public string AssignedBy { get; set; } 12 | 13 | public string TenantId { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/Models/TodoContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | 3 | namespace ToDoListService.Models 4 | { 5 | public class TodoContext : DbContext 6 | { 7 | public TodoContext(DbContextOptions options) 8 | : base(options) 9 | { 10 | 11 | } 12 | 13 | public DbSet TodoItems { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | 6 | # testing 7 | /coverage 8 | 9 | # production 10 | /build 11 | 12 | # misc 13 | .DS_Store 14 | .env.local 15 | .env.development.local 16 | .env.test.local 17 | .env.production.local 18 | 19 | npm-debug.log* 20 | yarn-debug.log* 21 | yarn-error.log* 22 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "CallGraphBFF", 3 | "name": "CallGraphBFF", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | } 10 | ], 11 | "start_url": "./index.html", 12 | "display": "standalone", 13 | "theme_color": "#000000", 14 | "background_color": "#ffffff" 15 | } 16 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/components/NavMenu.css: -------------------------------------------------------------------------------- 1 | a.navbar-brand { 2 | white-space: normal; 3 | text-align: center; 4 | word-break: break-all; 5 | } 6 | 7 | html { 8 | font-size: 14px; 9 | } 10 | @media (min-width: 768px) { 11 | html { 12 | font-size: 16px; 13 | } 14 | } 15 | 16 | .box-shadow { 17 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 18 | } 19 | 20 | .navlink:hover { 21 | cursor: pointer; 22 | } 23 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Views/Home/Claims.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Claims 2 | 3 | @{ 4 | ViewData["Title"] = "Claims"; 5 | } 6 |

@ViewData["Title"].

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | @foreach (Claim claim in User.Claims) 15 | { 16 | 17 | 18 | 19 | 20 | } 21 |
Claim TypeClaim Value
@claim.Type@claim.Value
-------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/reportWebVitals.js: -------------------------------------------------------------------------------- 1 | const reportWebVitals = (onPerfEntry) => { 2 | if (onPerfEntry && onPerfEntry instanceof Function) { 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 4 | getCLS(onPerfEntry); 5 | getFID(onPerfEntry); 6 | getFCP(onPerfEntry); 7 | getLCP(onPerfEntry); 8 | getTTFB(onPerfEntry); 9 | }); 10 | } 11 | }; 12 | 13 | export default reportWebVitals; 14 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/Home/UnauthorizedTenant.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "UnauthorizedTenant"; 3 | } 4 | 5 |

Unauthorized Tenant

6 |

You have signed-in with an user account from a Tenant that hasn't on-boarded this application yet.

7 |

Please complete the authorization process via the onboarding process by clicking on the link below.

8 | Take me to the onboarding process -------------------------------------------------------------------------------- /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/DAL/SampleDbContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using WebApp_MultiTenant_v2.Models; 3 | 4 | namespace WebApp_MultiTenant_v2.DAL 5 | { 6 | public class SampleDbContext : DbContext 7 | { 8 | public SampleDbContext(DbContextOptions options) : base(options) { } 9 | 10 | public DbSet AuthorizedTenants { get; set; } 11 | public DbSet TodoItems { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/Models/TodoItem.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace ToDoListService.Models 5 | { 6 | public class TodoItem 7 | { 8 | public int Id { get; set; } 9 | public string Title { get; set; } 10 | public string AssignedTo { get; set; } 11 | public string Assignedby { get; set; } 12 | public string TenantId { get; set; } 13 | } 14 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/components/Layout.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Container } from 'reactstrap'; 3 | import { NavMenu } from './NavMenu'; 4 | 5 | export class Layout extends Component { 6 | static displayName = Layout.name; 7 | 8 | render() { 9 | return ( 10 |
11 | 12 | 13 | {this.props.children} 14 | 15 |
16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/App.test.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { createRoot } from 'react-dom/client'; 3 | import { MemoryRouter } from 'react-router-dom'; 4 | import App from './App'; 5 | 6 | it('renders without crashing', async () => { 7 | const div = document.createElement('div'); 8 | const root = createRoot(div); 9 | root.render( 10 | 11 | 12 | ); 13 | await new Promise(resolve => setTimeout(resolve, 1000)); 14 | }); 15 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Controllers/AccountController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet.Controllers 5 | { 6 | public class AccountController : Controller 7 | { 8 | [Authorize] 9 | public new IActionResult SignOut() 10 | { 11 | HttpContext.Session.Clear(); 12 | return RedirectToAction("SignOut", "Account", new { area = "MicrosoftIdentity" }); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/TodoListService.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | aspnet-TodoListService-03230DB1-5145-408C-A48B-BE3DAFC56C30 6 | 0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/TodoListService.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | aspnet-TodoListService-03230DB1-5145-408C-A48B-BE3DAFC56C30 6 | 0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 | @if (TempData["ErrorMessage"] != null) 17 | { 18 |

@TempData["ErrorMessage"]

19 | } 20 | 21 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Services/ARM/ArmSimplifiedDataModel.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Services.Arm 2 | { 3 | /// 4 | /// Result of Arm List tenant. We are only interested in Arm tenants 5 | /// 6 | class ArmResult 7 | { 8 | public ArmTenant[] value { get; set; } 9 | } 10 | 11 | /// 12 | /// In a Tenant, we are only interested in the tenant ID 13 | /// 14 | class ArmTenant 15 | { 16 | public string tenantId { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | ASP.NET Core web app signing-in users in your organization 7 |

8 |

9 | This sample shows how to build a .NET Core MVC Web app that uses OpenID Connect to sign in users in your organization. It leverages the ASP.NET Core OpenID Connect middleware. 10 |

11 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | ASP.NET Core web app signing-in users to your Azure AD B2C tenant. 7 |

8 |

9 | This sample shows how to build a .NET Core MVC Web app that uses OpenID Connect to sign in users in an Azure AD B2C tenant. It leverages the ASP.NET Core OpenID Connect middleware. 10 |

11 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Infrastructure/Constants.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | { 3 | public static class Constants 4 | { 5 | public const string ScopeUserRead = "User.Read"; 6 | public const string ScopeUserReadAll = "User.ReadBasic.All"; 7 | public const string BearerAuthorizationScheme = "Bearer"; 8 | public const string UserConsentDeclinedErrorMessage = "User declined to consent to access the app"; 9 | public const string UserConsentDeclinedError = "AADSTS65004"; 10 | } 11 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.Identity.Web 2 | @if (User.Identity.IsAuthenticated) 3 | { 4 | 8 | } 9 | else 10 | { 11 | 14 | } 15 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:5000/", 7 | "sslPort": 5000 8 | } 9 | }, 10 | "profiles": { 11 | "webApp": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:5000" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.Identity.Web 2 | @if (User.Identity.IsAuthenticated) 3 | { 4 | 8 | } 9 | else 10 | { 11 | 14 | } 15 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/2-5-HybridFlow.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | WebApp_OpenIDConnect_DotNet 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.Identity.Web 2 | @if (User.Identity.IsAuthenticated) 3 | { 4 | 8 | } 9 | else 10 | { 11 | 14 | } 15 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Principal 2 | @if (User.Identity.IsAuthenticated) 3 | { 4 | 8 | } 9 | else 10 | { 11 | 14 | } 15 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44321/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "webApp": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 4 | "version": "3.2.9", 5 | "_release": "3.2.9", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "v3.2.9", 9 | "commit": "a91f5401898e125f10771c5f5f0909d8c4c82396" 10 | }, 11 | "_source": "https://github.com/aspnet/jquery-validation-unobtrusive.git", 12 | "_target": "^3.2.9", 13 | "_originalSource": "jquery-validation-unobtrusive", 14 | "_direct": true 15 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Services/MicrosoftGraph-Rest/IGraphApiOperations.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Threading.Tasks; 4 | 5 | namespace WebApp_OpenIDConnect_DotNet.Services.GraphOperations 6 | { 7 | public interface IGraphApiOperations 8 | { 9 | Task GetUserInformation(string accessToken); 10 | Task GetPhotoAsBase64Async(string accessToken); 11 | 12 | Task> EnumerateTenantsIdAndNameAccessibleByUser(IEnumerable tenantIds, Func> getTokenForTenant); 13 | } 14 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3110/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "webApp": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /UiTests/AnyOrgOrPersonalUiTest/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AzureAd": { 3 | "Instance": "https://login.microsoftonline.com/", 4 | "Domain": "msidlab3.onmicrosoft.com", 5 | "TenantId": "8e44f19d-bbab-4a82-b76b-4cd0a6fbc97a", 6 | "ClientId": "d9cde0be-ad97-41e6-855e-2f85136671c1", 7 | "CallbackPath": "/signin-oidc", 8 | "SignedOutCallbackPath": "/signout-callback-oidc" 9 | }, 10 | "Logging": { 11 | "LogLevel": { 12 | "Default": "Information", 13 | "Microsoft": "Warning", 14 | "Microsoft.Hosting.Lifetime": "Information" 15 | } 16 | }, 17 | "AllowedHosts": "*" 18 | } 19 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44321/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "webApp": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3110/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "webApp": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44321/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "webApp": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/Extensions/QueriesExtensions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | using System.Threading.Tasks; 7 | using ToDoListService.Models; 8 | 9 | namespace ToDoListService.Extensions; 10 | public static class QueriesExtensions 11 | { 12 | public static async Task> WhereAsync(this DbSet dbSet, Expression> predicate) 13 | { 14 | return await dbSet.Where(predicate).ToArrayAsync(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation 3 | about: Suggest a change to the documentation. 4 | title: '[Documentation] ' 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Documentation related to component 11 | 12 | 13 | ### Please check all that apply 14 | 15 | - [ ] typo 16 | - [ ] documentation doesn't exist 17 | - [ ] documentation needs clarification 18 | - [ ] error(s) in the example 19 | - [ ] needs an example 20 | 21 | ### Description of the issue 22 | 23 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "nuget" 9 | directory: "/" 10 | schedule: 11 | interval: "daily" 12 | allow: 13 | - dependency-name: "Microsoft.Identity*" 14 | labels: 15 | - "dependabot" 16 | - "dependencies" 17 | -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a .NET project 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net 3 | 4 | name: .NET 5 | 6 | on: 7 | push: 8 | branches: [ "master" ] 9 | pull_request: 10 | branches: [ "master" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Setup .NET 20 | uses: actions/setup-dotnet@v3 21 | with: 22 | dotnet-version: 9.x 23 | - name: Build 24 | run: dotnet build buildAllSlns.proj 25 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44321/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "WebApp_OpenIDConnect_DotNet": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "applicationUrl": "https://localhost:44321;http://localhost:3110", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/ReadmeFiles/ReadmeTroubleshooting.md: -------------------------------------------------------------------------------- 1 | Use [Stack Overflow](http://stackoverflow.com/questions/tagged/adal) to get support from the community. 2 | Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before. 3 | Make sure that your questions or comments are tagged with [`azure-active-directory` `adal` `msal` `dotnet`]. 4 | 5 | If you find a bug in the sample, please raise the issue on [GitHub Issues](../../issues). 6 | 7 | To provide a recommendation, visit the following [User Voice page](https://feedback.azure.com/forums/169401-azure-active-directory). 8 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/ReadmeFiles/ReadmeNextSteps.md: -------------------------------------------------------------------------------- 1 | Learn how to: 2 | 3 | * [Change your app to sign-in users from any organization or any Microsoft accounts](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-3-AnyOrgOrPersonal) 4 | * [Enable users from National clouds to sign-in to your application](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-4-Sovereign) 5 | * [Enable your Web App to call a Web API on behalf of the signed-in user](https://github.com/Azure-Samples/ms-identity-dotnetcore-ca-auth-context-app) 6 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3110/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "WebApp_OpenIDConnect_DotNet": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44316/", 7 | "sslPort": 44316 8 | } 9 | }, 10 | "profiles": { 11 | "WebApp_OpenIDConnect_DotNet": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44316/;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/Program.cs: -------------------------------------------------------------------------------- 1 | 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace ToDoListService 6 | { 7 | public class Program 8 | { 9 | public static void Main(string[] args) 10 | { 11 | CreateHostBuilder(args).Build().Run(); 12 | } 13 | 14 | public static IHostBuilder CreateHostBuilder(string[] args) => 15 | Host.CreateDefaultBuilder(args) 16 | .ConfigureWebHostDefaults(webBuilder => 17 | { 18 | webBuilder.UseStartup(); 19 | }); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/Home/Users.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.Graph 2 | @{ 3 | ViewData["Title"] = "Users list"; 4 | } 5 | 6 |

Users in your tenant

7 | 8 | 9 | 10 | 11 | 12 | 13 | @{ 14 | IList users = ViewData["Users"] as IList; 15 | 16 | foreach (var user in users) 17 | { 18 | 19 | 20 | 21 | 22 | } 23 | } 24 |
PropertyValue
@user.DisplayName@user.UserPrincipalName
25 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace _2_1_Call_MSGraph 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Hosting; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | CreateHostBuilder(args).Build().Run(); 11 | } 12 | 13 | public static IHostBuilder CreateHostBuilder(string[] args) => 14 | Host.CreateDefaultBuilder(args) 15 | .ConfigureWebHostDefaults(webBuilder => 16 | { 17 | webBuilder.UseStartup(); 18 | }); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/setupProxy.js: -------------------------------------------------------------------------------- 1 | const { createProxyMiddleware } = require('http-proxy-middleware'); 2 | const { env } = require('process'); 3 | 4 | const target = env.ASPNETCORE_HTTPS_PORT ? `https://localhost:${env.ASPNETCORE_HTTPS_PORT}` : 5 | env.ASPNETCORE_URLS ? env.ASPNETCORE_URLS.split(';')[0] : 'http://localhost:13917'; 6 | 7 | const context = [ 8 | "/api", 9 | ]; 10 | 11 | module.exports = function(app) { 12 | const appProxy = createProxyMiddleware(context, { 13 | target: target, 14 | secure: false, 15 | headers: { 16 | Connection: 'Keep-Alive' 17 | } 18 | }); 19 | 20 | app.use(appProxy); 21 | }; 22 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3110/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "WebApp_OpenIDConnect_DotNet": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Services/IToDoListService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Graph; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using ToDoListClient.Models; 7 | 8 | namespace ToDoListClient.Services 9 | { 10 | public interface IToDoListService 11 | { 12 | Task> GetAsync(); 13 | 14 | Task GetAsync(int id); 15 | Task> GetAllGraphUsersAsync(); 16 | Task DeleteAsync(int id); 17 | 18 | Task AddAsync(ToDoItem todo); 19 | 20 | Task EditAsync(ToDoItem todo); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:3110/", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "WebApp_OpenIDConnect_DotNet": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | }, 17 | "applicationUrl": "https://localhost:44321;http://localhost:3110" 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/ToDoListClient.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | Secure an ASP.NET Core Web API with the Microsoft identity platform (Azure Active Directory) 7 |

8 |

9 | This sample shows how to secure a Web API built with ASP.NET Core using the Microsoft identity platform .The client uses OpenID Connect to sign in users. It leverages the ASP.NET Core OpenID Connect middleware 10 | and Microsoft.Identity.Web. 11 |

12 | 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Principal 2 | 3 | 20 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "3.3.1", 16 | "_release": "3.3.1", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "3.3.1", 20 | "commit": "9e8ec3d10fad04748176144f108d7355662ae75e" 21 | }, 22 | "_source": "https://github.com/jquery/jquery-dist.git", 23 | "_target": "^3.3.1", 24 | "_originalSource": "jquery", 25 | "_direct": true 26 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AzureAdB2C": { 3 | "Instance": "https://fabrikamb2c.b2clogin.com", 4 | "ClientId": "90c0fe63-bcf2-44d5-8fb7-b8bbc0b29dc6", 5 | "Domain": "fabrikamb2c.onmicrosoft.com", 6 | "SignedOutCallbackPath": "/signout/B2C_1_susi_reset_v2", 7 | "SignUpSignInPolicyId": "B2C_1_susi_reset_v2" 8 | //"CallbackPath": "/signin/B2C_1_sign_up_in" // defaults to /signin-oidc 9 | }, 10 | "Kestrel": { 11 | "Endpoints": { 12 | "Http": { 13 | "Url": "https://localhost:44332" 14 | } 15 | } 16 | }, 17 | "Logging": { 18 | "LogLevel": { 19 | "Default": "Warning" 20 | } 21 | }, 22 | "AllowedHosts": "*" 23 | } 24 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Principal 2 | 3 | 20 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Principal 2 | 3 | 20 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/ReadmeFiles/ReadmeContributing.md: -------------------------------------------------------------------------------- 1 | If you'd like to contribute to this sample, see [CONTRIBUTING.MD](/CONTRIBUTING.md). 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 4 | 5 | Feel free to to take part in our [sruvey](https://forms.microsoft.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR73pcsbpbxNJuZCMKN0lURpURFgxTzVOOE5BT1VCWDQ0U1hXT1hITVdCTSQlQCN0PWcu) to provide us with useful information to improve our samples in the future. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project. 4 | title: "[Feature Request] " 5 | labels: enhancement, Feature Request 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]. 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/WebApp-OpenIDConnect-DotNet-graph.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | aspnet-WebApp_OpenIDConnect_DotNet_graph-0701D544-D6FC-4E5A-84E4-B8DD052BA93F 6 | 0 7 | CallMSGraph 8 | CallMSGraph 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | Integrating Azure AD V2 into an ASP.NET Core web app and calling the Microsoft Graph API on behalf of the user 7 |

8 |

9 | This sample shows how to build a .NET Core MVC Web app that uses OpenID Connect to sign in users. Users can use personal accounts (including outlook.com, live.com, and others) as well as work and school accounts from any company or organization that has integrated with Azure Active Directory. It leverages the ASP.NET Core OpenID Connect middleware. 10 |

11 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Principal 2 | 3 | 20 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/ReadmeFiles/ReadmeTroubleshooting.md: -------------------------------------------------------------------------------- 1 | ## Troubleshooting 2 | 3 |
4 | Expand for troubleshooting info 5 | 6 | Use [Stack Overflow](http://stackoverflow.com/questions/tagged/msal) to get support from the community. 7 | Ask your questions on Stack Overflow first and browse existing issues to see if someone has asked your question before. 8 | Make sure that your questions or comments are tagged with [`azure-active-directory` `adal` `msal` `dotnet`]. 9 | 10 | If you find a bug in the sample, please raise the issue on [GitHub Issues](../../issues). 11 | 12 | To provide a recommendation, visit the following [User Voice page](https://feedback.azure.com/forums/169401-azure-active-directory). 13 |
14 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | namespace TodoListService 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | CreateHostBuilder(args).Build().Run(); 14 | } 15 | 16 | public static IHostBuilder CreateHostBuilder(string[] args) => 17 | Host.CreateDefaultBuilder(args) 18 | .ConfigureWebHostDefaults(webBuilder => 19 | { 20 | webBuilder.UseStartup(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | namespace WebApp_OpenIDConnect_DotNet 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | CreateHostBuilder(args).Build().Run(); 14 | } 15 | 16 | public static IHostBuilder CreateHostBuilder(string[] args) => 17 | Host.CreateDefaultBuilder(args) 18 | .ConfigureWebHostDefaults(webBuilder => 19 | { 20 | webBuilder.UseStartup(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | namespace TodoListService 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | CreateHostBuilder(args).Build().Run(); 14 | } 15 | 16 | public static IHostBuilder CreateHostBuilder(string[] args) => 17 | Host.CreateDefaultBuilder(args) 18 | .ConfigureWebHostDefaults(webBuilder => 19 | { 20 | webBuilder.UseStartup(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Program.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Hosting; 6 | 7 | namespace WebApp_OpenIDConnect_DotNet 8 | { 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | CreateHostBuilder(args).Build().Run(); 14 | } 15 | 16 | public static IHostBuilder CreateHostBuilder(string[] args) => 17 | Host.CreateDefaultBuilder(args) 18 | .ConfigureWebHostDefaults(webBuilder => 19 | { 20 | webBuilder.UseStartup(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | How to secure a Web API built with ASP.NET Core using the Microsoft identity platform (formerly Azure Active Directory for developers) 7 |

8 |

9 | This sample shows how to secure a Web API built with ASP.NET Core using the Microsoft identity platform (formerly Azure Active Directory for developers).The client uses OpenID Connect to sign in users. It leverages the ASP.NET Core OpenID Connect middleware 10 | and MSAL.NET. 11 |

12 | 13 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/TodoList/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model TodoListService.Models.Todo 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

ToDo Details

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 29 | 30 | 31 |
16 | @Html.DisplayFor(model => model.Id) 17 |
24 | @Html.DisplayFor(model => model.Owner) 25 | 27 | @Html.DisplayFor(model => model.Title) 28 |
32 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Services/MicrosoftGraph-Rest/Bootstrapper.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace WebApp_OpenIDConnect_DotNet.Services.GraphOperations 5 | { 6 | public static class Bootstrapper 7 | { 8 | public static void AddGraphService(this IServiceCollection services, IConfiguration configuration) 9 | { 10 | services.Configure(configuration); 11 | // https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests 12 | services.AddHttpClient(); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/TodoList/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model TodoListService.Models.Todo 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

ToDo Details

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 29 | 30 | 31 |
16 | @Html.DisplayFor(model => model.Id) 17 |
24 | @Html.DisplayFor(model => model.Owner) 25 | 27 | @Html.DisplayFor(model => model.Title) 28 |
32 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.Identity.Web; 2 | @if (User.Identity.IsAuthenticated) 3 | { 4 | 8 | } 9 | else 10 | { 11 | 14 | } 15 | @*@{ 16 | ViewData["Title"] = "_LoginPartial"; 17 | } 18 | 19 |

_LoginPartial

*@ 20 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | Integrating Azure AD V2 into an ASP.NET Core web app and calling the Microsoft Graph API on behalf of the user 7 |

8 |

9 | This sample shows how to build a .NET Core MVC Web app that uses OpenID Connect to sign in users. Users can use personal accounts (including outlook.com, live.com, and others) as well as work and school accounts from any company or organization that has integrated with Azure Active Directory. It leverages the ASP.NET Core OpenID Connect middleware. 10 |

11 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AzureAdB2C": { 3 | "Instance": "https://fabrikamb2c.b2clogin.com", 4 | "ClientId": "90c0fe63-bcf2-44d5-8fb7-b8bbc0b29dc6", 5 | "Domain": "fabrikamb2c.onmicrosoft.com", 6 | "SignedOutCallbackPath": "/signout/B2C_1_susi", 7 | "SignUpSignInPolicyId": "b2c_1_susi", 8 | "ResetPasswordPolicyId": "b2c_1_reset", 9 | "EditProfilePolicyId": "b2c_1_edit_profile" // Optional profile editing policy 10 | //"CallbackPath": "/signin/B2C_1_sign_up_in" // defaults to /signin-oidc 11 | }, 12 | "Logging": { 13 | "LogLevel": { 14 | "Default": "Information", 15 | "Microsoft": "Warning", 16 | "Microsoft.Hosting.Lifetime": "Information" 17 | } 18 | }, 19 | "AllowedHosts": "*" 20 | } 21 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |

6 | Integrating Azure AD V2 into an ASP.NET Core web app and calling the Microsoft Graph API, ARM and Azure Storage on behalf of the user 7 |

8 |

9 | This sample shows how to build a .NET Core MVC Web app that uses OpenID Connect to sign in users. Users can use personal accounts (including outlook.com, live.com, and others) as well as work and school accounts from any company or organization that has integrated with Azure Active Directory. It leverages the ASP.NET Core OpenID Connect middleware 10 | and MSAL.NET. 11 |

12 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Models/TodoItem.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.ComponentModel.DataAnnotations; 3 | using System.ComponentModel.DataAnnotations.Schema; 4 | 5 | namespace WebApp_MultiTenant_v2.Models 6 | { 7 | public class TodoItem 8 | { 9 | [Key] 10 | [DatabaseGenerated(DatabaseGeneratedOption.Identity)] 11 | public int Id { get; set; } 12 | 13 | [Required] 14 | public string Text { get; set; } 15 | 16 | [Required] 17 | [DisplayName("User Name")] 18 | public string UserName { get; set; } 19 | 20 | [Required] 21 | [DisplayName("Assigned To")] 22 | public string AssignedTo { get; set; } 23 | 24 | [Required] 25 | public string TenantId { get; set; } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/ReadmeFiles/ReadmePrerequirements.md: -------------------------------------------------------------------------------- 1 | * Either [Visual Studio](https://visualstudio.microsoft.com/downloads/) or [Visual Studio Code](https://code.visualstudio.com/download) and [.NET Core SDK](https://www.microsoft.com/net/learn/get-started) 2 | * An **Microsoft Entra ID** tenant. For more information, see: [How to get a Microsoft Entra tenant](https://docs.microsoft.com/azure/active-directory/develop/test-setup-environment#get-a-test-tenant) 3 | * A user account in your **Microsoft Entra ID** tenant. This sample will not work with a **personal Microsoft account**. If you're signed in to the [Microsoft Entra admin center](https://entra.microsoft.com) with a personal Microsoft account and have not created a user account in your directory before, you will need to create one before proceeding. 4 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/Home/Tenants.cshtml: -------------------------------------------------------------------------------- 1 | @using System 2 | @using System.Collections.Generic 3 | @{ 4 | ViewData["Title"] = "Tenants"; 5 | IDictionary tenants = ViewData["tenants"] as IDictionary; 6 | if (tenants == null) 7 | { 8 | tenants = (ViewData["tenants"] as IEnumerable).ToDictionary(name => name); 9 | } 10 | } 11 |

@ViewData["Title"]

12 |

@ViewData["Message"]

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | @foreach(var tenant in tenants) 21 | { 22 | 23 | 24 | 25 | 26 | } 27 |
Tenant IDTenant name
@tenant.Key@tenant.Value
-------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/ClientApp/src/App.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Route, Routes } from 'react-router-dom'; 3 | import AuthProviderHOC from './AuthProvider'; 4 | import { Layout } from './components/Layout'; 5 | import { FetchGraph } from "./components/FetchGraph"; 6 | import { Home } from './components/Home'; 7 | 8 | import './custom.css'; 9 | 10 | class App extends Component { 11 | static displayName = App.name; 12 | 13 | render() { 14 | return ( 15 | 16 | 17 | } /> 18 | } /> 19 | 20 | 21 | ); 22 | } 23 | } 24 | 25 | export default AuthProviderHOC(App); -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/Pages/Error.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using Microsoft.AspNetCore.Mvc.RazorPages; 3 | using System.Diagnostics; 4 | 5 | namespace CallGraphBFF.Pages 6 | { 7 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 8 | public class ErrorModel : PageModel 9 | { 10 | private readonly ILogger _logger; 11 | 12 | public ErrorModel(ILogger logger) 13 | { 14 | _logger = logger; 15 | } 16 | 17 | public string? RequestId { get; set; } 18 | 19 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 20 | 21 | public void OnGet() 22 | { 23 | RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Infrastructure/AuthorizationPolicies.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | { 3 | /// 4 | /// Contain all the authorization policies available in this application. 5 | /// 6 | public static class AuthorizationPolicies 7 | { 8 | /// 9 | /// this policy stipulates that users in both GroupMember and GroupAdmin can access resources 10 | /// 11 | public const string AssignmentToGroupMemberGroupRequired = "AssignmentToGroupMemberGroupRequired"; 12 | 13 | /// 14 | /// this policy stipulates that users in GroupAdmin can access resources 15 | /// 16 | public const string AssignmentToGroupAdminGroupRequired = "AssignmentToGroupAdminGroupRequired"; 17 | } 18 | } -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Infrastructure/CacheSettings.cs: -------------------------------------------------------------------------------- 1 | namespace WebApp_OpenIDConnect_DotNet.Infrastructure 2 | { 3 | /// 4 | /// Contains the cache settings for the memory cache instance used by this app to cache group memberships 5 | /// 6 | public class CacheSettings 7 | { 8 | /// 9 | /// Sets how long the cache entry can be inactive (e.g. not accessed) before it will be removed. 10 | /// This will not extend the entry lifetime beyond the absolute expiration (if set). 11 | /// 12 | public string SlidingExpirationInSeconds { get; set; } 13 | 14 | /// 15 | /// Sets an absolute expiration date for the cache entry. 16 | /// 17 | public string AbsoluteExpirationInSeconds { get; set; } 18 | } 19 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace ToDoListClient 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | 10 |

11 |

Enable your ASP.NET Core web app to sign in users and call Microsoft Graph with the Microsoft identity platform
12 |

13 | 14 |

Integrate an ASP.NET Core web app with the Microsoft Identity platform and calls Microsoft Graph API for the signed-in user

15 |
16 | 17 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

7 | An ASP.NET Core Web App accessing Web API that calls Microsoft Graph 8 |

9 |
10 |

11 | To enable the users on your tenant to access this application and the web API, 12 | you need to sign-in as an admin and consent for the required permissions. This makes the this app and the Web API available to all users in the tenant. 13 |

14 | 15 | Consent as Admin 16 | 17 |

18 | Note that you'd be asked to consent twice, once for the client app and then again for the Web API 19 |

20 |
-------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/Overview.md: -------------------------------------------------------------------------------- 1 | [![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/aad%20Samples/.NET%20client%20samples/ASP.NET%20Core%20Web%20App%20tutorial)](https://identitydivision.visualstudio.com/IDDP/_build/latest?definitionId=819) 2 | 3 | ## Overview 4 | 5 | This sample demonstrates an ASP.NET Core web app that calls the Microsoft Graph API for a signed-in user. 6 | 7 | ## Scenario 8 | 9 | 1. The ASP.NET Core client web app uses the [Microsoft.Identity.Web](https://aka.ms/microsoft-identity-web) to sign a user in, and obtain a JWT [access Tokens](https://aka.ms/access-tokens) from **Microsoft Entra ID**. 10 | 1. The access token is used by the client app as a bearer token to call Microsoft Graph. 11 | 12 | ![Sign in with the Microsoft identity platform and call Graph](ReadmeFiles/sign-in.png) 13 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:35980", 7 | "sslPort": 44395 8 | } 9 | }, 10 | "profiles": { 11 | "razor_hybrid_spa": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:44321;http://localhost:5279", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AzureAd": { 3 | "Instance": "https://login.microsoftonline.com/", 4 | "Domain": "[Enter the domain of your tenant, e.g. contoso.onmicrosoft.com]", 5 | "TenantId": "[Enter 'common', or 'organizations' or the Tenant Id (Obtained from the Azure portal. Select 'Endpoints' from the 'App registrations' blade and use the GUID in any of the URLs), e.g. da41245a5-11b3-996c-00a8-4d99re19f292]", 6 | "ClientId": "[Enter the Client Id (Application ID obtained from the Azure portal), e.g. ba74781c2-53c2-442a-97c2-3d60re42f403]" 7 | }, 8 | "Kestrel": { 9 | "Endpoints": { 10 | "Http": { 11 | "Url": "https://localhost:44351" 12 | } 13 | } 14 | }, 15 | "Logging": { 16 | "LogLevel": { 17 | "Default": "Warning" 18 | } 19 | }, 20 | "AllowedHosts": "*" 21 | } 22 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | using WebApp_OpenIDConnect_DotNet.Models; 5 | 6 | namespace WebApp_OpenIDConnect_DotNet.Controllers 7 | { 8 | public class HomeController : Controller 9 | { 10 | public IActionResult Index() 11 | { 12 | return View(); 13 | } 14 | 15 | [Authorize] 16 | public IActionResult Claims() 17 | { 18 | return View(); 19 | } 20 | 21 | [AllowAnonymous] 22 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 23 | public IActionResult Error() 24 | { 25 | return View(new ErrorViewModel {RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier}); 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using Microsoft.Identity.Web 2 | @if (User.Identity.IsAuthenticated) 3 | { 4 | 13 | } 14 | else 15 | { 16 | 19 | } 20 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.Hosting; 4 | using Microsoft.Extensions.Logging; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace WebApp_OpenIDConnect_DotNet_graph 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:47464", 7 | "sslPort": 44321 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApp_OpenIDConnect_DotNet_graph": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "applicationUrl": "https://localhost:44321;http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development", 24 | "KEY_VAULT_URI": "ENTER_YOUR_KEY_VAULT_URI" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/WebApp-OpenIDConnect-DotNet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | aspnet-WebApp_OpenIDConnect_DotNet-81EA87AD-E64D-4755-A1CC-5EA47F49B5D8 6 | 0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/TodoListService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44332/", 7 | "sslPort": 44332 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "https://localhost:44332/", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "TodoListService": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | }, 26 | "applicationUrl": "https://localhost:44332/" 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/TodoList/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model TodoListService.Models.Todo 2 | @{ 3 | ViewData["Title"] = "Create"; 4 | } 5 | 6 |

Create ToDo

7 | 8 |

Todo

9 |
10 |
11 |
12 |
13 |
14 |
15 | 16 | 17 | 18 |
19 |
20 | 21 |
22 |
23 |
24 |
25 | 26 |
27 | Back to List 28 |
-------------------------------------------------------------------------------- /2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | @using System.Security.Principal 2 | 3 | 23 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using System.Diagnostics; 5 | using WebApp_OpenIDConnect_DotNet.Models; 6 | 7 | namespace WebApp_OpenIDConnect_DotNet.Controllers 8 | { 9 | [Authorize] 10 | public class HomeController : Controller 11 | { 12 | public HomeController() 13 | { 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | ViewData["User"] = HttpContext.User; 19 | return View(); 20 | } 21 | 22 | [AllowAnonymous] 23 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 24 | public IActionResult Error() 25 | { 26 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /UiTests/HybridFlowUiTest/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AzureAd": { 3 | "Instance": "https://login.microsoftonline.com/", 4 | "Domain": "msidlab4.onmicrosoft.com", 5 | "TenantId": "f645ad92-e38d-4d1a-b510-d1b09a74a8ca", 6 | "ClientId": "9a192b78-6580-4f8a-aace-f36ffea4f7be", 7 | "CallbackPath": "/signin-oidc", 8 | "SignedOutCallbackPath": "/signout-callback-oidc", 9 | "ClientCertificates": [ 10 | { 11 | "SourceType": "KeyVault", 12 | "KeyVaultUrl": "https://webappsapistests.vault.azure.net", 13 | "KeyVaultCertificateName": "Self-Signed-5-5-22" 14 | } 15 | ] 16 | }, 17 | "Logging": { 18 | "LogLevel": { 19 | "Default": "Warning" 20 | } 21 | }, 22 | "AllowedHosts": "*", 23 | "DownstreamApi": { 24 | "BaseUrl": "https://graph.microsoft.com/v1.0", 25 | "Scopes": "user.read contacts.read" 26 | }, 27 | "SpaRedirectUri": "https://localhost:44321/" 28 | } 29 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/TodoListService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44351", 7 | "sslPort": 44351 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "https://localhost:44351/", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "TodoListService": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | }, 26 | "applicationUrl": "http://localhost:1040/", 27 | "sslPort": 44351 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/WebApp-OpenIDConnect-DotNet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | aspnet-WebApp_OpenIDConnect_DotNet-81EA87AD-E64D-4755-A1CC-5EA47F49B5D8 6 | 0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "https://localhost:44351", 7 | "sslPort": 44351 8 | } 9 | }, 10 | "$schema": "http://json.schemastore.org/launchsettings.json", 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "https://localhost:44351/api/todolist", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "ToDoListService": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | }, 26 | "applicationUrl": "https://localhost:44351/", 27 | "sslPort": 44351 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:13917", 7 | "sslPort": 44369 8 | } 9 | }, 10 | "profiles": { 11 | "CallGraphBFF": { 12 | "commandName": "Project", 13 | "launchBrowser": true, 14 | "applicationUrl": "https://localhost:7000;http://localhost:5260", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development", 17 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development", 25 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.SpaProxy" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-6-BFF-Proxy/Pages/Error.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model ErrorModel 3 | @{ 4 | ViewData["Title"] = "Error"; 5 | } 6 | 7 |

Error.

8 |

An error occurred while processing your request.

9 | 10 | @if (Model.ShowRequestId) 11 | { 12 |

13 | Request ID: @Model.RequestId 14 |

15 | } 16 | 17 |

Development Mode

18 |

19 | Swapping to the Development environment displays detailed information about the error that occurred. 20 |

21 |

22 | The Development environment shouldn't be enabled for deployed applications. 23 | It can result in displaying sensitive information from exceptions to end users. 24 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 25 | and restarting the app. 26 |

27 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-5-HybridFlow/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/Views/TodoList/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model TodoListService.Models.Todo 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete ToDo

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Todo

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Title) 16 |
17 |
18 | @Html.DisplayFor(model => model.Title) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Owner) 22 |
23 |
24 | @Html.DisplayFor(model => model.Owner) 25 |
26 |
27 | 28 |
29 | 30 | | 31 | Back to List 32 |
33 |
34 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/Controllers/AdminController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using System.Diagnostics; 5 | using WebApp_OpenIDConnect_DotNet.Infrastructure; 6 | using WebApp_OpenIDConnect_DotNet.Models; 7 | 8 | namespace WebApp_OpenIDConnect_DotNet.Controllers 9 | { 10 | [Authorize(Policy = AuthorizationPolicies.AssignmentToGroupAdminGroupRequired)] 11 | public class AdminController : Controller 12 | { 13 | public AdminController() 14 | { 15 | } 16 | 17 | public IActionResult Index() 18 | { 19 | return View(); 20 | } 21 | 22 | [AllowAnonymous] 23 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 24 | public IActionResult Error() 25 | { 26 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/Views/TodoList/DeleteItem.cshtml: -------------------------------------------------------------------------------- 1 | @model TodoListService.Models.Todo 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete ToDo

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Todo

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Title) 16 |
17 |
18 | @Html.DisplayFor(model => model.Title) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Owner) 22 |
23 |
24 | @Html.DisplayFor(model => model.Owner) 25 |
26 |
27 | 28 |
29 | 30 | | 31 | Back to List 32 |
33 |
34 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/TodoListService/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "AzureAd": { 3 | "Instance": "https://login.microsoftonline.com/", 4 | "Domain": "[Enter the domain of your tenant, e.g. contoso.onmicrosoft.com]", 5 | "TenantId": "common", 6 | "ClientId": "[Enter the Client Id (Application ID obtained from the Azure portal), e.g. ba74781c2-53c2-442a-97c2-3d60re42f403]", 7 | "ClientSecret": "[Copy the client secret added to the app from the Azure portal]", 8 | "ClientCapabilities": [ "cp1" ], 9 | "AllowedTenants": [ "Add the tenant ids of the tenants from where you want the client applications to call your Web API" ] 10 | }, 11 | "https_port": 44351, 12 | "Logging": { 13 | "LogLevel": { 14 | "Default": "Information", 15 | "Microsoft": "Warning", 16 | "Microsoft.Hosting.Lifetime": "Information" 17 | } 18 | }, 19 | "DownstreamApi": { 20 | "GraphApiUrl": "https://graph.microsoft.com/v1.0", 21 | "Scopes": "user.read.all" 22 | }, 23 | "AllowedHosts": "*" 24 | } 25 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-2-TokenCache/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /3-WebApp-multi-APIs/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-3-AnyOrg/ToDoListClient/Views/ToDoList/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model ToDoListClient.Models.ToDoItem 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete ToDo

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Todo

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Title) 16 |
17 |
18 | @Html.DisplayFor(model => model.Title) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.AssignedTo) 22 |
23 |
24 | @Html.DisplayFor(model => model.AssignedTo) 25 |
26 |
27 | 28 |
29 | 30 | | 31 | Back to List 32 |
33 |
34 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-1-MyOrg/WebApp-OpenIDConnect-DotNet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | 6 | aspnet-WebApp_OpenIDConnect_DotNet-81EA87AD-E64D-4755-A1CC-5EA47F49B5D8 7 | 0 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /1-WebApp-OIDC/1-5-B2C/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-1-Call-MSGraph/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-1-Roles/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /5-WebApp-AuthZ/5-2-Groups/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-1-MyOrg/Client/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /4-WebApp-your-API/4-2-B2C/Client/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\ 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | body { 4 | padding-top: 50px; 5 | padding-bottom: 20px; 6 | } 7 | 8 | /* Wrapping element */ 9 | /* Set some basic padding to keep content from hitting the edges */ 10 | .body-content { 11 | padding-left: 15px; 12 | padding-right: 15px; 13 | } 14 | 15 | /* Carousel */ 16 | .carousel-caption p { 17 | font-size: 20px; 18 | line-height: 1.4; 19 | } 20 | 21 | /* Make .svg files in the carousel display properly in older browsers */ 22 | .carousel-inner .item img[src$=".svg"] { 23 | width: 100%; 24 | } 25 | 26 | /* QR code generator */ 27 | #qrCode { 28 | margin: 15px; 29 | } 30 | 31 | /* Hide/rearrange for smaller screens */ 32 | @media screen and (max-width: 767px) { 33 | /* Hide captions */ 34 | .carousel-caption { 35 | display: none; 36 | } 37 | } 38 | --------------------------------------------------------------------------------