├── MsftBuild2018.AwesomeComputers_After ├── B2CTraining │ ├── wwwroot │ │ ├── js │ │ │ ├── site.min.js │ │ │ └── site.js │ │ ├── favicon.ico │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ ├── dist │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ └── js │ │ │ │ │ │ └── npm.js │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE │ │ │ ├── jquery │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE.txt │ │ │ ├── jquery-validation │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE.md │ │ │ └── jquery-validation-unobtrusive │ │ │ │ ├── .bower.json │ │ │ │ └── jquery.validate.unobtrusive.min.js │ │ └── css │ │ │ ├── site.min.css │ │ │ └── site.css │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Shared │ │ │ └── _Layout.cshtml │ │ └── Home │ │ │ └── Index.cshtml │ ├── appsettings.json │ ├── Controllers │ │ └── HomeController.cs │ ├── B2CTraining.csproj │ ├── Program.cs │ ├── bundleconfig.json │ └── Startup.cs ├── AwesomeComputers │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Shared │ │ │ ├── _LoginPartial.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ └── Web.config │ ├── Global.asax │ ├── favicon.ico │ ├── Content │ │ ├── logo.png │ │ └── Site.css │ ├── Scripts │ │ ├── _references.js │ │ ├── profile-dropdown.js │ │ ├── respond.min.js │ │ └── respond.matchmedia.addListener.min.js │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── Controllers │ │ └── HomeController.cs │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── RouteConfig.cs │ │ ├── BundleConfig.cs │ │ └── Startup.Auth.cs │ ├── Startup.cs │ ├── Global.asax.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── packages.config │ ├── Models │ │ └── MSALSessionCache.cs │ └── Web.config ├── .nuget │ ├── NuGet.exe │ └── NuGet.Config ├── StoreMembershipApi │ ├── Models │ │ ├── MembershipRequest.cs │ │ ├── ValidationResponseContent.cs │ │ ├── MembershipDateResponseContent.cs │ │ └── StoreResponseContent.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Program.cs │ ├── StoreMembershipApi.csproj │ ├── Startup.cs │ └── Controllers │ │ └── MembershipController.cs └── B2C-WebAPI-DotNet.sln ├── MsftBuild2018.AwesomeComputers_Before ├── B2CTraining │ ├── wwwroot │ │ ├── js │ │ │ ├── site.min.js │ │ │ └── site.js │ │ ├── favicon.ico │ │ ├── lib │ │ │ ├── bootstrap │ │ │ │ ├── dist │ │ │ │ │ ├── fonts │ │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ │ └── js │ │ │ │ │ │ └── npm.js │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE │ │ │ ├── jquery │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE.txt │ │ │ ├── jquery-validation │ │ │ │ ├── .bower.json │ │ │ │ └── LICENSE.md │ │ │ └── jquery-validation-unobtrusive │ │ │ │ ├── .bower.json │ │ │ │ └── jquery.validate.unobtrusive.min.js │ │ └── css │ │ │ ├── site.min.css │ │ │ └── site.css │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Shared │ │ │ └── _Layout.cshtml │ │ └── Home │ │ │ └── Index.cshtml │ ├── appsettings.json │ ├── Controllers │ │ └── HomeController.cs │ ├── B2CTraining.csproj │ ├── Program.cs │ ├── bundleconfig.json │ └── Startup.cs ├── AwesomeComputers │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Shared │ │ │ ├── _LoginPartial.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Home │ │ │ └── Index.cshtml │ │ └── Web.config │ ├── Global.asax │ ├── favicon.ico │ ├── Content │ │ ├── logo.png │ │ └── Site.css │ ├── Scripts │ │ ├── _references.js │ │ ├── profile-dropdown.js │ │ ├── respond.min.js │ │ └── respond.matchmedia.addListener.min.js │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── Controllers │ │ └── HomeController.cs │ ├── App_Start │ │ ├── FilterConfig.cs │ │ ├── RouteConfig.cs │ │ └── BundleConfig.cs │ ├── Startup.cs │ ├── Global.asax.cs │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── packages.config │ ├── Models │ │ └── MSALSessionCache.cs │ └── Web.config ├── .nuget │ ├── NuGet.exe │ └── NuGet.Config ├── StoreMembershipApi │ ├── Models │ │ ├── MembershipRequest.cs │ │ ├── ValidationResponseContent.cs │ │ ├── MembershipDateResponseContent.cs │ │ └── StoreResponseContent.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Program.cs │ ├── StoreMembershipApi.csproj │ ├── Startup.cs │ └── Controllers │ │ └── MembershipController.cs └── B2C-WebAPI-DotNet.sln ├── ui-customizations ├── images │ ├── logo.jpg │ ├── facebook.png │ ├── microsoft.png │ ├── background.jpg │ ├── googleplus.png │ ├── salesforce.png │ ├── logo-high-res.png │ ├── activedirectory.png │ └── background_high-res.jpg ├── fonts │ ├── Ubuntu-Bold.ttf │ ├── Ubuntu-Regular.ttf │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff └── unified.html ├── CHANGELOG.md ├── policies ├── Module7 │ ├── Module7Info.txt │ └── SignUpOrSigninUsingSalesforceAndGoogle.xml ├── notes.txt ├── Module6 │ └── ProfileEditObtainApiClaim.xml └── Module5 │ └── SignUpOrSignin.xml ├── README.md ├── .github ├── ISSUE_TEMPLATE.md └── PULL_REQUEST_TEMPLATE.md ├── LICENSE.md ├── Users ├── UsersData.json ├── UsersDataResetPasswords.json └── UsersSocialData.json ├── CONTRIBUTING.md └── .gitignore /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } 4 | -------------------------------------------------------------------------------- /ui-customizations/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/logo.jpg -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using B2CTraining 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using B2CTraining 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /ui-customizations/images/facebook.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/facebook.png -------------------------------------------------------------------------------- /ui-customizations/images/microsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/microsoft.png -------------------------------------------------------------------------------- /ui-customizations/fonts/Ubuntu-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/fonts/Ubuntu-Bold.ttf -------------------------------------------------------------------------------- /ui-customizations/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/background.jpg -------------------------------------------------------------------------------- /ui-customizations/images/googleplus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/googleplus.png -------------------------------------------------------------------------------- /ui-customizations/images/salesforce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/salesforce.png -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="AwesomeComputers.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ui-customizations/fonts/Ubuntu-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/fonts/Ubuntu-Regular.ttf -------------------------------------------------------------------------------- /ui-customizations/images/logo-high-res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/logo-high-res.png -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="AwesomeComputers.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /ui-customizations/images/activedirectory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/activedirectory.png -------------------------------------------------------------------------------- /ui-customizations/images/background_high-res.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/images/background_high-res.jpg -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/.nuget/NuGet.exe -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/.nuget/NuGet.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/.nuget/NuGet.exe -------------------------------------------------------------------------------- /ui-customizations/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /ui-customizations/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /ui-customizations/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/ui-customizations/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/favicon.ico -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/favicon.ico -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/favicon.ico -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Content/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Content/logo.png -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Content/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Content/logo.png -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/favicon.ico -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Scripts/_references.js -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/.nuget/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Scripts/_references.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Scripts/_references.js -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/Models/MembershipRequest.cs: -------------------------------------------------------------------------------- 1 | namespace StoreMembershipApi.Models 2 | { 3 | public class MembershipRequest 4 | { 5 | public int StoreMembershipNumber { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Models/MembershipRequest.cs: -------------------------------------------------------------------------------- 1 | namespace StoreMembershipApi.Models 2 | { 3 | public class MembershipRequest 4 | { 5 | public int StoreMembershipNumber { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/AwesomeComputers/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/Models/ValidationResponseContent.cs: -------------------------------------------------------------------------------- 1 | namespace StoreMembershipApi.Models 2 | { 3 | public class ValidationResponseContent : StoreResponseContent 4 | { 5 | public string StoreMembershipNumber { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Models/ValidationResponseContent.cs: -------------------------------------------------------------------------------- 1 | namespace StoreMembershipApi.Models 2 | { 3 | public class ValidationResponseContent : StoreResponseContent 4 | { 5 | public string StoreMembershipNumber { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/Models/MembershipDateResponseContent.cs: -------------------------------------------------------------------------------- 1 | namespace StoreMembershipApi.Models 2 | { 3 | public class MembershipDateResponseContent : StoreResponseContent 4 | { 5 | public string StoreMembershipDate { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Models/MembershipDateResponseContent.cs: -------------------------------------------------------------------------------- 1 | namespace StoreMembershipApi.Models 2 | { 3 | public class MembershipDateResponseContent : StoreResponseContent 4 | { 5 | public string StoreMembershipDate { get; set; } 6 | } 7 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/active-directory-b2c-training-course/HEAD/MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace AwesomeComputers.Controllers 4 | { 5 | [Authorize] 6 | public class HomeController : Controller 7 | { 8 | public ActionResult Index() 9 | { 10 | return View(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | }, 8 | "BasicAuth": { 9 | "Username": "B2CServiceUserAccount", 10 | "Password": "4q3cLJE1MZDYDMdbLLbe3j9azKcZnjl/DyHHtbFkpeg=" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace AwesomeComputers.Controllers 4 | { 5 | [Authorize] 6 | public class HomeController : Controller 7 | { 8 | public ActionResult Index() 9 | { 10 | return View(); 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | }, 8 | "BasicAuth": { 9 | "Username": "B2CServiceUserAccount", 10 | "Password": "4q3cLJE1MZDYDMdbLLbe3j9azKcZnjl/DyHHtbFkpeg=" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace B2CTraining.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public IActionResult Index() 8 | { 9 | return View(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace B2CTraining.Controllers 4 | { 5 | public class HomeController : Controller 6 | { 7 | public IActionResult Index() 8 | { 9 | return View(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/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}} -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/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}} -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace AwesomeComputers 4 | { 5 | public class FilterConfig 6 | { 7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 8 | { 9 | filters.Add(new HandleErrorAttribute()); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/App_Start/FilterConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | 3 | namespace AwesomeComputers 4 | { 5 | public class FilterConfig 6 | { 7 | public static void RegisterGlobalFilters(GlobalFilterCollection filters) 8 | { 9 | filters.Add(new HandleErrorAttribute()); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Startup.cs: -------------------------------------------------------------------------------- 1 | using AwesomeComputers; 2 | using Microsoft.Owin; 3 | using Owin; 4 | 5 | [assembly: OwinStartup(typeof(Startup))] 6 | 7 | namespace AwesomeComputers 8 | { 9 | public partial class Startup 10 | { 11 | public void Configuration(IAppBuilder app) 12 | { 13 | ConfigureAuth(app); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Startup.cs: -------------------------------------------------------------------------------- 1 | using AwesomeComputers; 2 | using Microsoft.Owin; 3 | using Owin; 4 | 5 | [assembly: OwinStartup(typeof(Startup))] 6 | 7 | namespace AwesomeComputers 8 | { 9 | public partial class Startup 10 | { 11 | public void Configuration(IAppBuilder app) 12 | { 13 | ConfigureAuth(app); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Scripts/profile-dropdown.js: -------------------------------------------------------------------------------- 1 | var $profileDiv = $("#profile-options"); 2 | var $profileLink = $("#profile-link"); 3 | $profileLink.click(function (event) { 4 | event.preventDefault(); 5 | $profileDiv.show(); 6 | }); 7 | $(document).mouseup(function (event) { 8 | if (!$profileDiv.is(event.target) && $profileDiv.has(event.target).length === 0) 9 | $profileDiv.hide(); 10 | }); -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Scripts/profile-dropdown.js: -------------------------------------------------------------------------------- 1 | var $profileDiv = $("#profile-options"); 2 | var $profileLink = $("#profile-link"); 3 | $profileLink.click(function (event) { 4 | event.preventDefault(); 5 | $profileDiv.show(); 6 | }); 7 | $(document).mouseup(function (event) { 8 | if (!$profileDiv.is(event.target) && $profileDiv.has(event.target).length === 0) 9 | $profileDiv.hide(); 10 | }); -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/B2CTraining.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/B2CTraining.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace B2CTraining 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | BuildWebHost(args).Run(); 11 | } 12 | 13 | public static IWebHost BuildWebHost(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup() 16 | .Build(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace B2CTraining 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | BuildWebHost(args).Run(); 11 | } 12 | 13 | public static IWebHost BuildWebHost(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup() 16 | .Build(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace StoreMembershipApi 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | BuildWebHost(args).Run(); 11 | } 12 | 13 | public static IWebHost BuildWebHost(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup() 16 | .Build(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore; 2 | using Microsoft.AspNetCore.Hosting; 3 | 4 | namespace StoreMembershipApi 5 | { 6 | public class Program 7 | { 8 | public static void Main(string[] args) 9 | { 10 | BuildWebHost(args).Run(); 11 | } 12 | 13 | public static IWebHost BuildWebHost(string[] args) => 14 | WebHost.CreateDefaultBuilder(args) 15 | .UseStartup() 16 | .Build(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/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') -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/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') -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Optimization; 3 | using System.Web.Routing; 4 | 5 | namespace AwesomeComputers 6 | { 7 | public class MvcApplication : System.Web.HttpApplication 8 | { 9 | protected void Application_Start() 10 | { 11 | AreaRegistration.RegisterAllAreas(); 12 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 13 | RouteConfig.RegisterRoutes(RouteTable.Routes); 14 | BundleConfig.RegisterBundles(BundleTable.Bundles); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Optimization; 3 | using System.Web.Routing; 4 | 5 | namespace AwesomeComputers 6 | { 7 | public class MvcApplication : System.Web.HttpApplication 8 | { 9 | protected void Application_Start() 10 | { 11 | AreaRegistration.RegisterAllAreas(); 12 | FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); 13 | RouteConfig.RegisterRoutes(RouteTable.Routes); 14 | BundleConfig.RegisterBundles(BundleTable.Bundles); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace AwesomeComputers 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | routes.MapRoute( 13 | name: "Default", 14 | url: "{controller}/{action}/{id}", 15 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Mvc; 2 | using System.Web.Routing; 3 | 4 | namespace AwesomeComputers 5 | { 6 | public class RouteConfig 7 | { 8 | public static void RegisterRoutes(RouteCollection routes) 9 | { 10 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 11 | 12 | routes.MapRoute( 13 | name: "Default", 14 | url: "{controller}/{action}/{id}", 15 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/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": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/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": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/Models/StoreResponseContent.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Reflection; 3 | 4 | namespace StoreMembershipApi.Models 5 | { 6 | public class StoreResponseContent 7 | { 8 | public string Version { get; set; } 9 | public int Status { get; set; } 10 | public string UserMessage { get; set; } 11 | 12 | public StoreResponseContent() 13 | { } 14 | 15 | public StoreResponseContent(string message, HttpStatusCode status) 16 | { 17 | this.UserMessage = message; 18 | this.Status = (int)status; 19 | this.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Models/StoreResponseContent.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Reflection; 3 | 4 | namespace StoreMembershipApi.Models 5 | { 6 | public class StoreResponseContent 7 | { 8 | public string Version { get; set; } 9 | public int Status { get; set; } 10 | public string UserMessage { get; set; } 11 | 12 | public StoreResponseContent() 13 | { } 14 | 15 | public StoreResponseContent(string message, HttpStatusCode status) 16 | { 17 | this.UserMessage = message; 18 | this.Status = (int)status; 19 | this.Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /policies/Module7/Module7Info.txt: -------------------------------------------------------------------------------- 1 | Salesforce 2 | =================================================================================== 3 | Username: aadb2ctraining@gmail.com 4 | Email: aadb2ctraining@gmail.com 5 | Password: 6Rk4mCYT2Z 6 | Security Question: In what city were you born? 7 | Answer: Redmond 8 | Metadata Discovery Endpoint: https://b2ctraining-dev-ed.my.salesforce.com/.well-known/samlidp/Awesome_Computers.xml 9 | Certificate password: 8&HsQ< 10 | 11 | Google 12 | =================================================================================== 13 | Username: aadb2ctraining@gmail.com 14 | Password: 6Rk4mCYT2Z 15 | Client id: 376020570008-aa4ou70429ritt4ir9pb3up0qvoi5tct.apps.googleusercontent.com 16 | Client secret: Nvm7pqK2P7KaQB6WoemPeSJY -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Views/Shared/_LoginPartial.cshtml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/StoreMembershipApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/StoreMembershipApi.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | PreserveNewest 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Project Name 2 | 3 | (short, 1-3 sentenced, description of the project) 4 | 5 | ## Features 6 | 7 | This project framework provides the following features: 8 | 9 | * Feature 1 10 | * Feature 2 11 | * ... 12 | 13 | ## Getting Started 14 | 15 | ### Prerequisites 16 | 17 | (ideally very short, if any) 18 | 19 | - OS 20 | - Library version 21 | - ... 22 | 23 | ### Installation 24 | 25 | (ideally very short) 26 | 27 | - npm install [package name] 28 | - mvn install 29 | - ... 30 | 31 | ### Quickstart 32 | (Add steps to get up and running quickly) 33 | 34 | 1. git clone [repository clone url] 35 | 2. cd [respository name] 36 | 3. ... 37 | 38 | 39 | ## Demo 40 | 41 | A demo app is included to show how to use the project. 42 | 43 | To run the demo, follow these steps: 44 | 45 | (Add steps to start up the demo) 46 | 47 | 1. 48 | 2. 49 | 3. 50 | 51 | ## Resources 52 | 53 | (Any additional resources or related projects) 54 | 55 | - Link to supporting information 56 | - Link to similar sample 57 | - ... 58 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 4 | > Please provide us with the following information: 5 | > --------------------------------------------------------------- 6 | 7 | ### This issue is for a: (mark with an `x`) 8 | ``` 9 | - [ ] bug report -> please search issues before submitting 10 | - [ ] feature request 11 | - [ ] documentation issue or request 12 | - [ ] regression (a behavior that used to work and stopped in a new release) 13 | ``` 14 | 15 | ### Minimal steps to reproduce 16 | > 17 | 18 | ### Any log messages given by the failure 19 | > 20 | 21 | ### Expected/desired behavior 22 | > 23 | 24 | ### OS and Version? 25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) 26 | 27 | ### Versions 28 | > 29 | 30 | ### Mention any other details that might be useful 31 | 32 | > --------------------------------------------------------------- 33 | > Thanks! We'll be in touch soon. 34 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | 3 | * ... 4 | 5 | ## Does this introduce a breaking change? 6 | 7 | ``` 8 | [ ] Yes 9 | [ ] No 10 | ``` 11 | 12 | ## Pull Request Type 13 | What kind of change does this Pull Request introduce? 14 | 15 | 16 | ``` 17 | [ ] Bugfix 18 | [ ] Feature 19 | [ ] Code style update (formatting, local variables) 20 | [ ] Refactoring (no functional changes, no api changes) 21 | [ ] Documentation content changes 22 | [ ] Other... Please describe: 23 | ``` 24 | 25 | ## How to Test 26 | * Get the code 27 | 28 | ``` 29 | git clone [repo-address] 30 | cd [repo-name] 31 | git checkout [branch-name] 32 | npm install 33 | ``` 34 | 35 | * Test the code 36 | 37 | ``` 38 | ``` 39 | 40 | ## What to Check 41 | Verify that the following are valid 42 | * ... 43 | 44 | ## Other Information 45 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. All rights reserved. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Users/UsersData.json: -------------------------------------------------------------------------------- 1 | { 2 | "Users": [ 3 | { 4 | "email": "James@contoso.com", 5 | "displayName": "James Davis", 6 | "firstName": "James", 7 | "lastName": "Davis", 8 | "password": "1234567" 9 | }, 10 | { 11 | "email": "Linda@contoso.com", 12 | "displayName": "Linda Taylor", 13 | "firstName": "Linda", 14 | "lastName": "Taylor", 15 | "password": "1234567" 16 | }, 17 | { 18 | "email": "William@contoso.com", 19 | "displayName": "William Martin", 20 | "firstName": "William", 21 | "lastName": "Martin", 22 | "password": "1234567" 23 | }, 24 | { 25 | "email": "Thomas@contoso.com", 26 | "displayName": "Thomas Lee", 27 | "firstName": "Thomas", 28 | "lastName": "Lee", 29 | "password": "1234567" 30 | }, 31 | { 32 | "email": "Lisa@contoso.com", 33 | "displayName": "Lisa Bell", 34 | "firstName": "Lisa", 35 | "lastName": "Bell", 36 | "password": "1234567" 37 | }, 38 | { 39 | "email": "Emily@contoso.com", 40 | "displayName": "Emily King", 41 | "firstName": "Emily", 42 | "lastName": "King", 43 | "password": "1234567" 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /ui-customizations/unified.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sign in 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |
19 | 20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Users/UsersDataResetPasswords.json: -------------------------------------------------------------------------------- 1 | { 2 | "Users": [ 3 | { 4 | "email": "Fred@contoso.com", 5 | "displayName": "Fred Davis", 6 | "firstName": "Fred", 7 | "lastName": "Davis", 8 | "password": "12345678" 9 | }, 10 | { 11 | "email": "Belinda@contoso.com", 12 | "displayName": "Belinda Taylor", 13 | "firstName": "Belinda", 14 | "lastName": "Taylor", 15 | "password": "12345678" 16 | }, 17 | { 18 | "email": "Herbert@contoso.com", 19 | "displayName": "Herbert Martin", 20 | "firstName": "Herbert", 21 | "lastName": "Martin", 22 | "password": "12345678" 23 | }, 24 | { 25 | "email": "Sid@contoso.com", 26 | "displayName": "Sid Lee", 27 | "firstName": "Sid", 28 | "lastName": "Lee", 29 | "password": "12345678" 30 | }, 31 | { 32 | "email": "Sharon@contoso.com", 33 | "displayName": "Sharon Bell", 34 | "firstName": "Sharon", 35 | "lastName": "Bell", 36 | "password": "12345678" 37 | }, 38 | { 39 | "email": "Emilia@contoso.com", 40 | "displayName": "Emilia King", 41 | "firstName": "Emilia", 42 | "lastName": "King", 43 | "password": "12345678" 44 | } 45 | ] 46 | } -------------------------------------------------------------------------------- /policies/notes.txt: -------------------------------------------------------------------------------- 1 | TRAINING: 2 | https://aadb2ctraining.azurewebsites.net 3 | 4 | MODULE 1: 5 | https://aadb2cmodule1.azurewebsites.net 6 | https://login.microsoftonline.com/aadb2ctraining.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1_SignInSignUp&client_id=b8aa71f6-fa3d-45e2-9454-7e85a983aa89&nonce=defaultNonce&redirect_uri=https%3A%2F%2Flocalhost%3A44316&scope=openid&response_type=id_token&prompt=login 7 | Add link to go back to b2c training 8 | Make it a little prettier, add image 9 | 10 | MODULE 2: 11 | https://aadb2cmodule2.azurewebsites.net 12 | https://login.microsoftonline.com/aadb2ctraining.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1A_Module2SignupSignin&client_id=b8aa71f6-fa3d-45e2-9454-7e85a983aa89&nonce=defaultNonce&redirect_uri=https%3A%2F%2Flocalhost%3A44316&scope=openid&response_type=id_token&prompt=login 13 | 14 | MODULE 3: 15 | 16 | 17 | MODULE 4: 18 | https://login.microsoftonline.com/aadb2ctraining.onmicrosoft.com/oauth2/v2.0/authorize?p=B2C_1_Module4SignupSigninCustomized&client_id=b8aa71f6-fa3d-45e2-9454-7e85a983aa89&nonce=defaultNonce&redirect_uri=https%3A%2F%2Faadb2cmodule1.azurewebsites.net&scope=openid&response_type=id_token&prompt=login 19 | Modify all tenant branding options 20 | 21 | MODULE 5: 22 | building block has datetime stamp sample -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace AwesomeComputers 4 | { 5 | public class BundleConfig 6 | { 7 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 8 | public static void RegisterBundles(BundleCollection bundles) 9 | { 10 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 11 | "~/Scripts/jquery-{version}.js")); 12 | 13 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 14 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 15 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 16 | "~/Scripts/modernizr-*")); 17 | 18 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 19 | "~/Scripts/bootstrap.js", 20 | "~/Scripts/respond.js")); 21 | 22 | bundles.Add(new StyleBundle("~/Content/css").Include( 23 | "~/Content/bootstrap.css", 24 | "~/Content/site.css")); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/App_Start/BundleConfig.cs: -------------------------------------------------------------------------------- 1 | using System.Web.Optimization; 2 | 3 | namespace AwesomeComputers 4 | { 5 | public class BundleConfig 6 | { 7 | // For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862 8 | public static void RegisterBundles(BundleCollection bundles) 9 | { 10 | bundles.Add(new ScriptBundle("~/bundles/jquery").Include( 11 | "~/Scripts/jquery-{version}.js")); 12 | 13 | // Use the development version of Modernizr to develop with and learn from. Then, when you're 14 | // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. 15 | bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( 16 | "~/Scripts/modernizr-*")); 17 | 18 | bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include( 19 | "~/Scripts/bootstrap.js", 20 | "~/Scripts/respond.js")); 21 | 22 | bundles.Add(new StyleBundle("~/Content/css").Include( 23 | "~/Content/bootstrap.css", 24 | "~/Content/site.css")); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("TaskWebApp")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("TaskWebApp")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("04859550-a63c-4b8e-85d1-e19407a5b6f8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Revision and Build Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("TaskWebApp")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("TaskWebApp")] 12 | [assembly: AssemblyCopyright("Copyright © 2014")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("04859550-a63c-4b8e-85d1-e19407a5b6f8")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Revision and Build Numbers 32 | // by using the '*' as shown below: 33 | [assembly: AssemblyVersion("1.0.0.0")] 34 | [assembly: AssemblyFileVersion("1.0.0.0")] 35 | -------------------------------------------------------------------------------- /Users/UsersSocialData.json: -------------------------------------------------------------------------------- 1 | { 2 | "Users": [ 3 | { 4 | "accountEnabled": true, 5 | "displayName": "AAA BBB", 6 | "userPrincipalName" : "aabb@jscmtenant.onmicrosoft.com", 7 | "passwordProfile": { 8 | "password": "Test1234", 9 | "forceChangePasswordNextLogin": false 10 | }, 11 | "mailNickname" : "aabb", 12 | "userIdentities": [ 13 | { 14 | "issuer": "facebook.com", 15 | "issuerUserId": "MATxTNg5MzYyMzMyMNY1Njc=" 16 | } 17 | ] 18 | }, 19 | { 20 | "accountEnabled": true, 21 | "displayName": "CCC DDD", 22 | "userPrincipalName" : "ccdd@jscmtenant.onmicrosoft.com", 23 | "passwordProfile": { 24 | "password": "Test1234", 25 | "forceChangePasswordNextLogin": false 26 | }, 27 | "mailNickname" : "ccdd", 28 | "userIdentities": [ 29 | { 30 | "issuer": "facebook.com", 31 | "issuerUserId": "NATxTNg5MzYyMzMyMNY1Njc=" 32 | } 33 | ] 34 | }, 35 | { 36 | "accountEnabled": true, 37 | "displayName": "EEE FFF", 38 | "userPrincipalName" : "eeff@jscmtenant.onmicrosoft.com", 39 | "passwordProfile": { 40 | "password": "Test1234", 41 | "forceChangePasswordNextLogin": false 42 | }, 43 | "mailNickname" : "eeff", 44 | "userIdentities": [ 45 | { 46 | "issuer": "facebook.com", 47 | "issuerUserId": "OATxTNg5MzYyMzMyMNY1Njc=" 48 | } 49 | ] 50 | } 51 | ] 52 | } 53 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace B2CTraining 7 | { 8 | public class Startup 9 | { 10 | public Startup(IConfiguration configuration) 11 | { 12 | Configuration = configuration; 13 | } 14 | 15 | public IConfiguration Configuration { get; } 16 | 17 | // This method gets called by the runtime. Use this method to add services to the container. 18 | public void ConfigureServices(IServiceCollection services) 19 | { 20 | services.AddMvc(); 21 | } 22 | 23 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 24 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 25 | { 26 | if (env.IsDevelopment()) 27 | { 28 | app.UseBrowserLink(); 29 | app.UseDeveloperExceptionPage(); 30 | } 31 | else 32 | { 33 | app.UseExceptionHandler("/Home/Error"); 34 | } 35 | 36 | app.UseStaticFiles(); 37 | 38 | app.UseMvc(routes => 39 | { 40 | routes.MapRoute( 41 | name: "default", 42 | template: "{controller=Home}/{action=Index}/{id?}"); 43 | }); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Builder; 2 | using Microsoft.AspNetCore.Hosting; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace B2CTraining 7 | { 8 | public class Startup 9 | { 10 | public Startup(IConfiguration configuration) 11 | { 12 | Configuration = configuration; 13 | } 14 | 15 | public IConfiguration Configuration { get; } 16 | 17 | // This method gets called by the runtime. Use this method to add services to the container. 18 | public void ConfigureServices(IServiceCollection services) 19 | { 20 | services.AddMvc(); 21 | } 22 | 23 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 24 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 25 | { 26 | if (env.IsDevelopment()) 27 | { 28 | app.UseBrowserLink(); 29 | app.UseDeveloperExceptionPage(); 30 | } 31 | else 32 | { 33 | app.UseExceptionHandler("/Home/Error"); 34 | } 35 | 36 | app.UseStaticFiles(); 37 | 38 | app.UseMvc(routes => 39 | { 40 | routes.MapRoute( 41 | name: "default", 42 | template: "{controller=Home}/{action=Index}/{id?}"); 43 | }); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 |

Welcome to Awesome Computers!

2 | 3 | 6 | 7 | 8 |
9 | Back To B2C Training 10 | 11 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 |

Welcome to Awesome Computers!

2 | 3 | 6 | 7 | 8 |
9 | Back To B2C Training 10 | 11 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Views/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/StoreMembershipApi/Startup.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Bazinga.AspNetCore.Authentication.Basic; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.DependencyInjection; 7 | 8 | namespace StoreMembershipApi 9 | { 10 | public class Startup 11 | { 12 | public Startup(IConfiguration configuration, IHostingEnvironment env) 13 | { 14 | var builder = new ConfigurationBuilder() 15 | .SetBasePath(env.ContentRootPath) 16 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 17 | .AddEnvironmentVariables(); 18 | 19 | Configuration = builder.Build(); 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services.AddMvc(); 28 | 29 | // NOTE: DO NOT USE THIS IN A PRODUCTION APPLICATION 30 | // THIS IS JUST AN EXAMPLE OF WORKING WITH AN AUTH SCHEME WITHIN YOUR POLICIES 31 | var basicAuthUsername = Configuration.GetValue("BasicAuth:Username"); 32 | var basicAuthPassword = Configuration.GetValue("BasicAuth:Password"); 33 | services.AddAuthentication(BasicAuthenticationDefaults.AuthenticationScheme) 34 | .AddBasicAuthentication(credentials => 35 | Task.FromResult( 36 | credentials.username == basicAuthUsername 37 | && credentials.password == basicAuthPassword)); 38 | } 39 | 40 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 41 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 42 | { 43 | if (env.IsDevelopment()) 44 | { 45 | app.UseDeveloperExceptionPage(); 46 | } 47 | 48 | app.UseAuthentication(); 49 | app.UseMvc(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Startup.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Bazinga.AspNetCore.Authentication.Basic; 3 | using Microsoft.AspNetCore.Builder; 4 | using Microsoft.AspNetCore.Hosting; 5 | using Microsoft.Extensions.Configuration; 6 | using Microsoft.Extensions.DependencyInjection; 7 | 8 | namespace StoreMembershipApi 9 | { 10 | public class Startup 11 | { 12 | public Startup(IConfiguration configuration, IHostingEnvironment env) 13 | { 14 | var builder = new ConfigurationBuilder() 15 | .SetBasePath(env.ContentRootPath) 16 | .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) 17 | .AddEnvironmentVariables(); 18 | 19 | Configuration = builder.Build(); 20 | } 21 | 22 | public IConfiguration Configuration { get; } 23 | 24 | // This method gets called by the runtime. Use this method to add services to the container. 25 | public void ConfigureServices(IServiceCollection services) 26 | { 27 | services.AddMvc(); 28 | 29 | // NOTE: DO NOT USE THIS IN A PRODUCTION APPLICATION 30 | // THIS IS JUST AN EXAMPLE OF WORKING WITH AN AUTH SCHEME WITHIN YOUR POLICIES 31 | var basicAuthUsername = Configuration.GetValue("BasicAuth:Username"); 32 | var basicAuthPassword = Configuration.GetValue("BasicAuth:Password"); 33 | services.AddAuthentication(BasicAuthenticationDefaults.AuthenticationScheme) 34 | .AddBasicAuthentication(credentials => 35 | Task.FromResult( 36 | credentials.username == basicAuthUsername 37 | && credentials.password == basicAuthPassword)); 38 | } 39 | 40 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 41 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 42 | { 43 | if (env.IsDevelopment()) 44 | { 45 | app.UseDeveloperExceptionPage(); 46 | } 47 | 48 | app.UseAuthentication(); 49 | app.UseMvc(); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | /* styles for validation helpers */ 20 | .field-validation-error { 21 | color: #b94a48; 22 | } 23 | 24 | .field-validation-valid { 25 | display: none; 26 | } 27 | 28 | input.input-validation-error { 29 | border: 1px solid #b94a48; 30 | } 31 | 32 | input[type="checkbox"].input-validation-error { 33 | border: 0 none; 34 | } 35 | 36 | .validation-summary-errors { 37 | color: #b94a48; 38 | } 39 | 40 | .validation-summary-valid { 41 | display: none; 42 | } 43 | 44 | #profile-options { 45 | display:none; 46 | z-index:100; 47 | background-color: rgb(238, 238, 238); 48 | position:absolute; 49 | border:solid; 50 | border-color: rgb(128, 128, 128); 51 | border-width:thin; 52 | } 53 | 54 | .profile-link { 55 | /*display:table-cell;*/ 56 | white-space:nowrap; 57 | 58 | } 59 | 60 | .profile-links { 61 | list-style-type:none; 62 | padding-left:10px; 63 | padding-right:10px; 64 | /*display:table-row;*/ 65 | } 66 | 67 | #profile-link { 68 | cursor:pointer; 69 | } 70 | 71 | .claim-table, table, td, th { 72 | margin-bottom:30px; 73 | border: solid; 74 | border-width:thin; 75 | border-color:rgb(187, 187, 187); 76 | background-color:rgb(238,238,238); 77 | width:100%; 78 | table-layout:fixed; 79 | } 80 | 81 | .claim-type { 82 | padding-right: 30px; 83 | text-align:left; 84 | } 85 | 86 | .claim-data { 87 | padding-left:5px; 88 | overflow-x:hidden; 89 | text-overflow:ellipsis; 90 | } 91 | 92 | .claim-head { 93 | background-color:rgb(157, 201, 212); 94 | } 95 | 96 | .navbar-blue { 97 | background-color: #0C64AE; 98 | border-color: #133653; 99 | height: 75px; 100 | } 101 | 102 | a { 103 | color: white; 104 | text-decoration: none; 105 | } 106 | 107 | .profile-links { 108 | background-color: #0C65AE; 109 | list-style-type: none; 110 | padding: 10px; 111 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | /* styles for validation helpers */ 20 | .field-validation-error { 21 | color: #b94a48; 22 | } 23 | 24 | .field-validation-valid { 25 | display: none; 26 | } 27 | 28 | input.input-validation-error { 29 | border: 1px solid #b94a48; 30 | } 31 | 32 | input[type="checkbox"].input-validation-error { 33 | border: 0 none; 34 | } 35 | 36 | .validation-summary-errors { 37 | color: #b94a48; 38 | } 39 | 40 | .validation-summary-valid { 41 | display: none; 42 | } 43 | 44 | #profile-options { 45 | display:none; 46 | z-index:100; 47 | background-color: rgb(238, 238, 238); 48 | position:absolute; 49 | border:solid; 50 | border-color: rgb(128, 128, 128); 51 | border-width:thin; 52 | } 53 | 54 | .profile-link { 55 | /*display:table-cell;*/ 56 | white-space:nowrap; 57 | 58 | } 59 | 60 | .profile-links { 61 | list-style-type:none; 62 | padding-left:10px; 63 | padding-right:10px; 64 | /*display:table-row;*/ 65 | } 66 | 67 | #profile-link { 68 | cursor:pointer; 69 | } 70 | 71 | .claim-table, table, td, th { 72 | margin-bottom:30px; 73 | border: solid; 74 | border-width:thin; 75 | border-color:rgb(187, 187, 187); 76 | background-color:rgb(238,238,238); 77 | width:100%; 78 | table-layout:fixed; 79 | } 80 | 81 | .claim-type { 82 | padding-right: 30px; 83 | text-align:left; 84 | } 85 | 86 | .claim-data { 87 | padding-left:5px; 88 | overflow-x:hidden; 89 | text-overflow:ellipsis; 90 | } 91 | 92 | .claim-head { 93 | background-color:rgb(157, 201, 212); 94 | } 95 | 96 | .navbar-blue { 97 | background-color: #0C64AE; 98 | border-color: #133653; 99 | height: 75px; 100 | } 101 | 102 | a { 103 | color: white; 104 | text-decoration: none; 105 | } 106 | 107 | .profile-links { 108 | background-color: #0C65AE; 109 | list-style-type: none; 110 | padding: 10px; 111 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2C-WebAPI-DotNet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2037 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{84AE09B1-A124-4886-B44D-B68ABF36AB67}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "B2CTraining", "B2CTraining\B2CTraining.csproj", "{183EC930-AB39-4E94-9BDD-FEB5990C128C}" 14 | EndProject 15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeComputers", "AwesomeComputers\AwesomeComputers.csproj", "{07D1C353-4626-4D20-A804-531517BCF3F5}" 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StoreMembershipApi", "StoreMembershipApi\StoreMembershipApi.csproj", "{6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Release|Any CPU.Build.0 = Release|Any CPU 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {2BA69382-A5E0-4925-AF05-5C18C54496AF} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2C-WebAPI-DotNet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2037 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{84AE09B1-A124-4886-B44D-B68ABF36AB67}" 7 | ProjectSection(SolutionItems) = preProject 8 | .nuget\NuGet.Config = .nuget\NuGet.Config 9 | .nuget\NuGet.exe = .nuget\NuGet.exe 10 | .nuget\NuGet.targets = .nuget\NuGet.targets 11 | EndProjectSection 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "B2CTraining", "B2CTraining\B2CTraining.csproj", "{183EC930-AB39-4E94-9BDD-FEB5990C128C}" 14 | EndProject 15 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AwesomeComputers", "AwesomeComputers\AwesomeComputers.csproj", "{07D1C353-4626-4D20-A804-531517BCF3F5}" 16 | EndProject 17 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StoreMembershipApi", "StoreMembershipApi\StoreMembershipApi.csproj", "{6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|Any CPU = Debug|Any CPU 22 | Release|Any CPU = Release|Any CPU 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 26 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Debug|Any CPU.Build.0 = Debug|Any CPU 27 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Release|Any CPU.ActiveCfg = Release|Any CPU 28 | {183EC930-AB39-4E94-9BDD-FEB5990C128C}.Release|Any CPU.Build.0 = Release|Any CPU 29 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 30 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Debug|Any CPU.Build.0 = Debug|Any CPU 31 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Release|Any CPU.ActiveCfg = Release|Any CPU 32 | {07D1C353-4626-4D20-A804-531517BCF3F5}.Release|Any CPU.Build.0 = Release|Any CPU 33 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 34 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Debug|Any CPU.Build.0 = Debug|Any CPU 35 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Release|Any CPU.ActiveCfg = Release|Any CPU 36 | {6B8315E5-6FE8-4EF8-9B36-C94DB9CC2026}.Release|Any CPU.Build.0 = Release|Any CPU 37 | EndGlobalSection 38 | GlobalSection(SolutionProperties) = preSolution 39 | HideSolutionNode = FALSE 40 | EndGlobalSection 41 | GlobalSection(ExtensibilityGlobals) = postSolution 42 | SolutionGuid = {2BA69382-A5E0-4925-AF05-5C18C54496AF} 43 | EndGlobalSection 44 | EndGlobal 45 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Awesome Computers 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 |
12 | 34 |
35 | @RenderBody() 36 |
37 |
38 |

© @DateTime.Now.Year - Awesome Computers, Inc.

39 |
40 |
41 | 42 | @Scripts.Render("~/bundles/jquery") 43 | @Scripts.Render("~/bundles/bootstrap") 44 | @RenderSection("scripts", required: false) 45 | 46 | 47 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Awesome Computers 7 | @Styles.Render("~/Content/css") 8 | @Scripts.Render("~/bundles/modernizr") 9 | 10 | 11 |
12 | 34 |
35 | @RenderBody() 36 |
37 |
38 |

© @DateTime.Now.Year - Awesome Computers, Inc.

39 |
40 |
41 | 42 | @Scripts.Render("~/bundles/jquery") 43 | @Scripts.Render("~/bundles/bootstrap") 44 | @RenderSection("scripts", required: false) 45 | 46 | 47 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /policies/Module6/ProfileEditObtainApiClaim.xml: -------------------------------------------------------------------------------- 1 | 12 | 13 | aadb2ctraining.onmicrosoft.com 14 | B2C_1A_TrustFrameworkExtensions 15 | 16 | 17 | 18 | 19 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 20 | 21 | 22 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 23 | 24 | 25 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 26 | 27 | 28 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 29 | 30 | 31 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | Rolling 40 | 86400 41 | 42 | 43 | 44 | PolicyProfile 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /policies/Module7/SignUpOrSigninUsingSalesforceAndGoogle.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | aadb2ctraining.onmicrosoft.com 16 | B2C_1A_TrustFrameworkExtensions 17 | 18 | 19 | 20 | 21 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 22 | 23 | 24 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 25 | 26 | 27 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 28 | 29 | 30 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Rolling 39 | 86400 40 | 41 | 42 | 43 | PolicyProfile 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Models/MSALSessionCache.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Web; 3 | using Microsoft.Identity.Client; 4 | 5 | namespace AwesomeComputers.Models 6 | { 7 | public class MSALSessionCache 8 | { 9 | private static ReaderWriterLockSlim SessionLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); 10 | string UserId = string.Empty; 11 | string CacheId = string.Empty; 12 | HttpContextBase httpContext = null; 13 | 14 | TokenCache cache = new TokenCache(); 15 | 16 | public MSALSessionCache(string userId, HttpContextBase httpcontext) 17 | { 18 | // not object, we want the SUB 19 | UserId = userId; 20 | CacheId = UserId + "_TokenCache"; 21 | httpContext = httpcontext; 22 | Load(); 23 | } 24 | 25 | public TokenCache GetMsalCacheInstance() 26 | { 27 | cache.SetBeforeAccess(BeforeAccessNotification); 28 | cache.SetAfterAccess(AfterAccessNotification); 29 | Load(); 30 | return cache; 31 | } 32 | 33 | public void SaveUserStateValue(string state) 34 | { 35 | SessionLock.EnterWriteLock(); 36 | httpContext.Session[CacheId + "_state"] = state; 37 | SessionLock.ExitWriteLock(); 38 | } 39 | public string ReadUserStateValue() 40 | { 41 | string state = string.Empty; 42 | SessionLock.EnterReadLock(); 43 | state = (string)httpContext.Session[CacheId + "_state"]; 44 | SessionLock.ExitReadLock(); 45 | return state; 46 | } 47 | public void Load() 48 | { 49 | SessionLock.EnterReadLock(); 50 | cache.Deserialize((byte[])httpContext.Session[CacheId]); 51 | SessionLock.ExitReadLock(); 52 | } 53 | 54 | public void Persist() 55 | { 56 | SessionLock.EnterWriteLock(); 57 | 58 | // Optimistically set HasStateChanged to false. We need to do it early to avoid losing changes made by a concurrent thread. 59 | cache.HasStateChanged = false; 60 | 61 | // Reflect changes in the persistent store 62 | httpContext.Session[CacheId] = cache.Serialize(); 63 | SessionLock.ExitWriteLock(); 64 | } 65 | 66 | // Triggered right before MSAL needs to access the cache. 67 | // Reload the cache from the persistent store in case it changed since the last access. 68 | void BeforeAccessNotification(TokenCacheNotificationArgs args) 69 | { 70 | Load(); 71 | } 72 | 73 | // Triggered right after MSAL accessed the cache. 74 | void AfterAccessNotification(TokenCacheNotificationArgs args) 75 | { 76 | // if the access operation resulted in a cache update 77 | if (cache.HasStateChanged) 78 | { 79 | Persist(); 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Models/MSALSessionCache.cs: -------------------------------------------------------------------------------- 1 | using System.Threading; 2 | using System.Web; 3 | using Microsoft.Identity.Client; 4 | 5 | namespace AwesomeComputers.Models 6 | { 7 | public class MSALSessionCache 8 | { 9 | private static ReaderWriterLockSlim SessionLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); 10 | string UserId = string.Empty; 11 | string CacheId = string.Empty; 12 | HttpContextBase httpContext = null; 13 | 14 | TokenCache cache = new TokenCache(); 15 | 16 | public MSALSessionCache(string userId, HttpContextBase httpcontext) 17 | { 18 | // not object, we want the SUB 19 | UserId = userId; 20 | CacheId = UserId + "_TokenCache"; 21 | httpContext = httpcontext; 22 | Load(); 23 | } 24 | 25 | public TokenCache GetMsalCacheInstance() 26 | { 27 | cache.SetBeforeAccess(BeforeAccessNotification); 28 | cache.SetAfterAccess(AfterAccessNotification); 29 | Load(); 30 | return cache; 31 | } 32 | 33 | public void SaveUserStateValue(string state) 34 | { 35 | SessionLock.EnterWriteLock(); 36 | httpContext.Session[CacheId + "_state"] = state; 37 | SessionLock.ExitWriteLock(); 38 | } 39 | public string ReadUserStateValue() 40 | { 41 | string state = string.Empty; 42 | SessionLock.EnterReadLock(); 43 | state = (string)httpContext.Session[CacheId + "_state"]; 44 | SessionLock.ExitReadLock(); 45 | return state; 46 | } 47 | public void Load() 48 | { 49 | SessionLock.EnterReadLock(); 50 | cache.Deserialize((byte[])httpContext.Session[CacheId]); 51 | SessionLock.ExitReadLock(); 52 | } 53 | 54 | public void Persist() 55 | { 56 | SessionLock.EnterWriteLock(); 57 | 58 | // Optimistically set HasStateChanged to false. We need to do it early to avoid losing changes made by a concurrent thread. 59 | cache.HasStateChanged = false; 60 | 61 | // Reflect changes in the persistent store 62 | httpContext.Session[CacheId] = cache.Serialize(); 63 | SessionLock.ExitWriteLock(); 64 | } 65 | 66 | // Triggered right before MSAL needs to access the cache. 67 | // Reload the cache from the persistent store in case it changed since the last access. 68 | void BeforeAccessNotification(TokenCacheNotificationArgs args) 69 | { 70 | Load(); 71 | } 72 | 73 | // Triggered right after MSAL accessed the cache. 74 | void AfterAccessNotification(TokenCacheNotificationArgs args) 75 | { 76 | // if the access operation resulted in a cache update 77 | if (cache.HasStateChanged) 78 | { 79 | Persist(); 80 | } 81 | } 82 | } 83 | } -------------------------------------------------------------------------------- /policies/Module5/SignUpOrSignin.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | aadb2ctraining.onmicrosoft.com 16 | B2C_1A_TrustFrameworkExtensions 17 | 18 | 19 | 20 | 21 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 22 | 23 | 24 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 25 | 26 | 27 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 28 | 29 | 30 | https://aadb2ctraining.blob.core.windows.net/aadb2ctraining/unified.html 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Rolling 39 | 86400 40 | 41 | 42 | 43 | PolicyProfile 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | B2C Training 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 |
21 | 35 |
36 | @RenderBody() 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 51 | 57 | 58 | 59 | 60 | 79 | 80 | @RenderSection("Scripts", required: false) 81 | 82 | 83 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | B2C Training 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 |
21 | 35 |
36 | @RenderBody() 37 |
38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 51 | 57 | 58 | 59 | 60 | 79 | 80 | @RenderSection("Scripts", required: false) 81 | 82 | 83 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to [project-title] 2 | 3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 5 | the rights to use your contribution. For details, visit https://cla.microsoft.com. 6 | 7 | When you submit a pull request, a CLA-bot will automatically determine whether you need to provide 8 | a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions 9 | provided by the bot. You will only need to do this once across all repos using our CLA. 10 | 11 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 12 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 13 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 14 | 15 | - [Code of Conduct](#coc) 16 | - [Issues and Bugs](#issue) 17 | - [Feature Requests](#feature) 18 | - [Submission Guidelines](#submit) 19 | 20 | ## Code of Conduct 21 | Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 22 | 23 | ## Found an Issue? 24 | If you find a bug in the source code or a mistake in the documentation, you can help us by 25 | [submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can 26 | [submit a Pull Request](#submit-pr) with a fix. 27 | 28 | ## Want a Feature? 29 | You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub 30 | Repository. If you would like to *implement* a new feature, please submit an issue with 31 | a proposal for your work first, to be sure that we can use it. 32 | 33 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr). 34 | 35 | ## Submission Guidelines 36 | 37 | ### Submitting an Issue 38 | Before you submit an issue, search the archive, maybe your question was already answered. 39 | 40 | If your issue appears to be a bug, and hasn't been reported, open a new issue. 41 | Help us to maximize the effort we can spend fixing issues and adding new 42 | features, by not reporting duplicate issues. Providing the following information will increase the 43 | chances of your issue being dealt with quickly: 44 | 45 | * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps 46 | * **Version** - what version is affected (e.g. 0.1.2) 47 | * **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you 48 | * **Browsers and Operating System** - is this a problem with all browsers? 49 | * **Reproduce the Error** - provide a live example or a unambiguous set of steps 50 | * **Related Issues** - has a similar issue been reported before? 51 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be 52 | causing the problem (line of code or commit) 53 | 54 | You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/[organization-name]/[repository-name]/issues/new]. 55 | 56 | ### Submitting a Pull Request (PR) 57 | Before you submit your Pull Request (PR) consider the following guidelines: 58 | 59 | * Search the repository (https://github.com/[organization-name]/[repository-name]/pulls) for an open or closed PR 60 | that relates to your submission. You don't want to duplicate effort. 61 | 62 | * Make your changes in a new git fork: 63 | 64 | * Commit your changes using a descriptive commit message 65 | * Push your fork to GitHub: 66 | * In GitHub, create a pull request 67 | * If we suggest changes then: 68 | * Make the required updates. 69 | * Rebase your fork and force push to your GitHub repository (this will update your Pull Request): 70 | 71 | ```shell 72 | git rebase master -i 73 | git push -f 74 | ``` 75 | 76 | That's it! Thank you for your contribution! 77 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Scripts/respond.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl 2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT 3 | * */ 4 | 5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b 6 |

Welcome

7 |

To Azure Active Directory B2C Training

8 | 9 | 10 |
11 | 12 |
13 |
14 |

Module 1 - Using Built In Policies

15 |
16 |
17 | Go 18 |
19 |
20 | 21 |
22 |
23 |

Module 2 - Using IDPs with Azure AD B2C

24 |
25 |
26 | Go 27 |
28 |
29 | 30 |
31 |
32 |

Module 3 - Application Integration

33 |
34 |
35 | Go 36 |
37 |
38 | 39 |
40 |
41 |

Module 4 - UX Customization using Built In Functionality

42 |
43 |
44 | Go 45 |
46 |
47 | 48 |
49 |
50 |

Module 5 - Custom Policies 1

51 |
52 |
53 | Go 54 |
55 |
56 | 57 |
58 |
59 |

Module 6 - Custom Policies 2 (REST APIs)

60 |
61 |
62 | Go 63 |
64 |
65 | 66 |
67 |
68 |

Module 7 — External IDPs, OIDC and SAML

69 |
70 |
71 | Go 72 |
73 |
-------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

To Azure Active Directory B2C Training

8 |
9 | 10 |
11 | 12 |
13 |
14 |

Module 1 - Using Built In Policies

15 |
16 |
17 | Go 18 |
19 |
20 | 21 |
22 |
23 |

Module 2 - Using IDPs with Azure AD B2C

24 |
25 |
26 | Go 27 |
28 |
29 | 30 |
31 |
32 |

Module 3 - Application Integration

33 |
34 |
35 | Go 36 |
37 |
38 | 39 |
40 |
41 |

Module 4 - UX Customization using Built In Functionality

42 |
43 |
44 | Go 45 |
46 |
47 | 48 |
49 |
50 |

Module 5 - Custom Policies 1

51 |
52 |
53 | Go 54 |
55 |
56 | 57 |
58 |
59 |

Module 6 - Custom Policies 2 (REST APIs)

60 |
61 |
62 | Go 63 |
64 |
65 | 66 |
67 |
68 |

Module 7 — External IDPs, OIDC and SAML

69 |
70 |
71 | Go 72 |
73 |
-------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Scripts/respond.matchmedia.addListener.min.js: -------------------------------------------------------------------------------- 1 | /*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl 2 | * Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT 3 | * */ 4 | 5 | !function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b #mq-test-1 { width: 42px; }',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";if(a.matchMedia&&a.matchMedia("all").addListener)return!1;var b=a.matchMedia,c=b("only all").matches,d=!1,e=0,f=[],g=function(){a.clearTimeout(e),e=a.setTimeout(function(){for(var c=0,d=f.length;d>c;c++){var e=f[c].mql,g=f[c].listeners||[],h=b(e.media).matches;if(h!==e.matches){e.matches=h;for(var i=0,j=g.length;j>i;i++)g[i].call(a,e)}}},30)};a.matchMedia=function(e){var h=b(e),i=[],j=0;return h.addListener=function(b){c&&(d||(d=!0,a.addEventListener("resize",g,!0)),0===j&&(j=f.push({mql:h,listeners:i})),i.push(b))},h.removeListener=function(a){for(var b=0,c=i.length;c>b;b++)i[b]===a&&i.splice(b,1)},h}}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b 10 | /// This controller is responsible for responding to requests from our custom policies 11 | /// to validate store membership numbers and retrieve customer membership dates. 12 | /// 13 | [Authorize] 14 | [Route("api/[controller]")] 15 | public class MembershipController : Controller 16 | { 17 | /// 18 | /// This method receives a storeMembershipnumber from the policy validation step and returns a 409 Conflict 19 | /// response if the store membership number is not valid (not a multiple of 5), and a 200 Ok response on 20 | /// successful validation of the store membership number. 21 | /// 22 | /// Passed from the policy validation step, contains a storeMembershipNumber. 23 | /// HTTP 200 Ok on success. HTTP 409 Conflict if provided an invalid store membership number. 24 | [HttpPost("validate")] 25 | public IActionResult ValidateMembershipNumber([FromBody] MembershipRequest request) 26 | { 27 | if (!IsStoreMembershipNumberValid(request.StoreMembershipNumber)) 28 | { 29 | return GenerateErrorMessageWithMessage("Store membership number is not valid, it must be a multiple of 5!"); 30 | } 31 | 32 | // Return the output claim(s) 33 | return Ok(new ValidationResponseContent 34 | { 35 | StoreMembershipNumber = request.StoreMembershipNumber.ToString() 36 | }); 37 | } 38 | 39 | /// 40 | /// This method receives a storeMembershipnumber from the policy orchestration step and returns a 409 Conflict 41 | /// response if the store membership number is not valid (not a multiple of 5), and a 200 Ok response containing 42 | /// the member's membership date if the store membership number is valid. 43 | /// 44 | /// Passed from the policy orchestration step, contains a storeMembershipNumber. 45 | /// HTTP 200 Ok on success with an obtained membership date. HTTP 409 Conflict if provided an invalid store membership number. 46 | [HttpPost("membershipdate")] 47 | public IActionResult GetMembershipDate([FromBody] MembershipRequest request) 48 | { 49 | if (!IsStoreMembershipNumberValid(request.StoreMembershipNumber)) 50 | { 51 | return GenerateErrorMessageWithMessage("Store membership number is not valid, it must be a multiple of 5!"); 52 | } 53 | 54 | var membershipDate = ObtainStoreMembershipDate(); 55 | return Ok(new MembershipDateResponseContent 56 | { 57 | Version = "1.0.0", 58 | Status = (int)HttpStatusCode.OK, 59 | UserMessage = "Membership date located successfully.", 60 | StoreMembershipDate = membershipDate.ToString("d") 61 | }); 62 | } 63 | 64 | /// 65 | /// Constructs an HTTP 409 Conflict IActionResult to return back to the validation or orchestration step. 66 | /// This is used to communicate with the policy steps to communicate an error state. 67 | /// 68 | /// The message to be passed back to the user to explain why the request failed. 69 | /// An IActionResult representing an HTTP 409 Conflict with a custom payload. 70 | private IActionResult GenerateErrorMessageWithMessage(string message) 71 | { 72 | return StatusCode((int)HttpStatusCode.Conflict, new MembershipDateResponseContent 73 | { 74 | Version = "1.0.0", 75 | Status = (int) HttpStatusCode.Conflict, 76 | UserMessage = message 77 | }); 78 | } 79 | 80 | /// 81 | /// Generates a date within the last 90 days to return as the store membership number for a member. 82 | /// In a production application you'd likely contact a database here to get a real membership date for a member. 83 | /// 84 | /// A DateTime representing the store membership date for a member. 85 | private static DateTime ObtainStoreMembershipDate() 86 | { 87 | var random = new Random(); 88 | var daysOffOfToday = random.Next(0, 90); 89 | var randomDate = DateTime.Now.AddDays(-daysOffOfToday); 90 | 91 | return randomDate; 92 | } 93 | 94 | /// 95 | /// Validates a provided store membership number by using the modulus operator (see more here) 96 | /// to determine if the provided store membership number is a multiple of 5. If it is, we return true, if not, we return false. 97 | /// 98 | /// The store membership number to be validated. 99 | /// True on successful validation, false if validation fails. 100 | private bool IsStoreMembershipNumberValid(int storeMembershipNumber) 101 | { 102 | if (storeMembershipNumber % 5 != 0) 103 | { 104 | return false; 105 | } 106 | 107 | return true; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/StoreMembershipApi/Controllers/MembershipController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using Microsoft.AspNetCore.Authorization; 4 | using Microsoft.AspNetCore.Mvc; 5 | using StoreMembershipApi.Models; 6 | 7 | namespace StoreMembershipApi.Controllers 8 | { 9 | /// 10 | /// This controller is responsible for responding to requests from our custom policies 11 | /// to validate store membership numbers and retrieve customer membership dates. 12 | /// 13 | [Authorize] 14 | [Route("api/[controller]")] 15 | public class MembershipController : Controller 16 | { 17 | /// 18 | /// This method receives a storeMembershipnumber from the policy validation step and returns a 409 Conflict 19 | /// response if the store membership number is not valid (not a multiple of 5), and a 200 Ok response on 20 | /// successful validation of the store membership number. 21 | /// 22 | /// Passed from the policy validation step, contains a storeMembershipNumber. 23 | /// HTTP 200 Ok on success. HTTP 409 Conflict if provided an invalid store membership number. 24 | [HttpPost("validate")] 25 | public IActionResult ValidateMembershipNumber([FromBody] MembershipRequest request) 26 | { 27 | if (!IsStoreMembershipNumberValid(request.StoreMembershipNumber)) 28 | { 29 | return GenerateErrorMessageWithMessage("Store membership number is not valid, it must be a multiple of 5!"); 30 | } 31 | 32 | // Return the output claim(s) 33 | return Ok(new ValidationResponseContent 34 | { 35 | StoreMembershipNumber = request.StoreMembershipNumber.ToString() 36 | }); 37 | } 38 | 39 | /// 40 | /// This method receives a storeMembershipnumber from the policy orchestration step and returns a 409 Conflict 41 | /// response if the store membership number is not valid (not a multiple of 5), and a 200 Ok response containing 42 | /// the member's membership date if the store membership number is valid. 43 | /// 44 | /// Passed from the policy orchestration step, contains a storeMembershipNumber. 45 | /// HTTP 200 Ok on success with an obtained membership date. HTTP 409 Conflict if provided an invalid store membership number. 46 | [HttpPost("membershipdate")] 47 | public IActionResult GetMembershipDate([FromBody] MembershipRequest request) 48 | { 49 | if (!IsStoreMembershipNumberValid(request.StoreMembershipNumber)) 50 | { 51 | return GenerateErrorMessageWithMessage("Store membership number is not valid, it must be a multiple of 5!"); 52 | } 53 | 54 | var membershipDate = ObtainStoreMembershipDate(); 55 | return Ok(new MembershipDateResponseContent 56 | { 57 | Version = "1.0.0", 58 | Status = (int)HttpStatusCode.OK, 59 | UserMessage = "Membership date located successfully.", 60 | StoreMembershipDate = membershipDate.ToString("d") 61 | }); 62 | } 63 | 64 | /// 65 | /// Constructs an HTTP 409 Conflict IActionResult to return back to the validation or orchestration step. 66 | /// This is used to communicate with the policy steps to communicate an error state. 67 | /// 68 | /// The message to be passed back to the user to explain why the request failed. 69 | /// An IActionResult representing an HTTP 409 Conflict with a custom payload. 70 | private IActionResult GenerateErrorMessageWithMessage(string message) 71 | { 72 | return StatusCode((int)HttpStatusCode.Conflict, new MembershipDateResponseContent 73 | { 74 | Version = "1.0.0", 75 | Status = (int) HttpStatusCode.Conflict, 76 | UserMessage = message 77 | }); 78 | } 79 | 80 | /// 81 | /// Generates a date within the last 90 days to return as the store membership number for a member. 82 | /// In a production application you'd likely contact a database here to get a real membership date for a member. 83 | /// 84 | /// A DateTime representing the store membership date for a member. 85 | private static DateTime ObtainStoreMembershipDate() 86 | { 87 | var random = new Random(); 88 | var daysOffOfToday = random.Next(0, 90); 89 | var randomDate = DateTime.Now.AddDays(-daysOffOfToday); 90 | 91 | return randomDate; 92 | } 93 | 94 | /// 95 | /// Validates a provided store membership number by using the modulus operator (see more here) 96 | /// to determine if the provided store membership number is a multiple of 5. If it is, we return true, if not, we return false. 97 | /// 98 | /// The store membership number to be validated. 99 | /// True on successful validation, false if validation fails. 100 | private bool IsStoreMembershipNumberValid(int storeMembershipNumber) 101 | { 102 | if (storeMembershipNumber % 5 != 0) 103 | { 104 | return false; 105 | } 106 | 107 | return true; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/B2CTraining/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/B2CTraining/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** Unobtrusive validation support library for jQuery and jQuery Validate 3 | ** Copyright (C) Microsoft Corporation. All rights reserved. 4 | */ 5 | !function(a){function e(a,e,n){a.rules[e]=n,a.message&&(a.messages[e]=a.message)}function n(a){return a.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function t(a){return a.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function r(a){return a.substr(0,a.lastIndexOf(".")+1)}function i(a,e){return 0===a.indexOf("*.")&&(a=a.replace("*.",e)),a}function o(e,n){var r=a(this).find("[data-valmsg-for='"+t(n[0].name)+"']"),i=r.attr("data-valmsg-replace"),o=i?a.parseJSON(i)!==!1:null;r.removeClass("field-validation-valid").addClass("field-validation-error"),e.data("unobtrusiveContainer",r),o?(r.empty(),e.removeClass("input-validation-error").appendTo(r)):e.hide()}function d(e,n){var t=a(this).find("[data-valmsg-summary=true]"),r=t.find("ul");r&&r.length&&n.errorList.length&&(r.empty(),t.addClass("validation-summary-errors").removeClass("validation-summary-valid"),a.each(n.errorList,function(){a("
  • ").html(this.message).appendTo(r)}))}function s(e){var n=e.data("unobtrusiveContainer");if(n){var t=n.attr("data-valmsg-replace"),r=t?a.parseJSON(t):null;n.addClass("field-validation-valid").removeClass("field-validation-error"),e.removeData("unobtrusiveContainer"),r&&n.empty()}}function l(e){var n=a(this),t="__jquery_unobtrusive_validation_form_reset";if(!n.data(t)){n.data(t,!0);try{n.data("validator").resetForm()}finally{n.removeData(t)}n.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors"),n.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}}function m(e){var n=a(e),t=n.data(v),r=a.proxy(l,e),i=p.unobtrusive.options||{},m=function(n,t){var r=i[n];r&&a.isFunction(r)&&r.apply(e,t)};return t||(t={options:{errorClass:i.errorClass||"input-validation-error",errorElement:i.errorElement||"span",errorPlacement:function(){o.apply(e,arguments),m("errorPlacement",arguments)},invalidHandler:function(){d.apply(e,arguments),m("invalidHandler",arguments)},messages:{},rules:{},success:function(){s.apply(e,arguments),m("success",arguments)}},attachValidation:function(){n.off("reset."+v,r).on("reset."+v,r).validate(this.options)},validate:function(){return n.validate(),n.valid()}},n.data(v,t)),t}var u,p=a.validator,v="unobtrusiveValidation";p.unobtrusive={adapters:[],parseElement:function(e,n){var t,r,i,o=a(e),d=o.parents("form")[0];d&&(t=m(d),t.options.rules[e.name]=r={},t.options.messages[e.name]=i={},a.each(this.adapters,function(){var n="data-val-"+this.name,t=o.attr(n),s={};void 0!==t&&(n+="-",a.each(this.params,function(){s[this]=o.attr(n+this)}),this.adapt({element:e,form:d,message:t,params:s,rules:r,messages:i}))}),a.extend(r,{__dummy__:!0}),n||t.attachValidation())},parse:function(e){var n=a(e),t=n.parents().addBack().filter("form").add(n.find("form")).has("[data-val=true]");n.find("[data-val=true]").each(function(){p.unobtrusive.parseElement(this,!0)}),t.each(function(){var a=m(this);a&&a.attachValidation()})}},u=p.unobtrusive.adapters,u.add=function(a,e,n){return n||(n=e,e=[]),this.push({name:a,params:e,adapt:n}),this},u.addBool=function(a,n){return this.add(a,function(t){e(t,n||a,!0)})},u.addMinMax=function(a,n,t,r,i,o){return this.add(a,[i||"min",o||"max"],function(a){var i=a.params.min,o=a.params.max;i&&o?e(a,r,[i,o]):i?e(a,n,i):o&&e(a,t,o)})},u.addSingleVal=function(a,n,t){return this.add(a,[n||"val"],function(r){e(r,t||a,r.params[n])})},p.addMethod("__dummy__",function(a,e,n){return!0}),p.addMethod("regex",function(a,e,n){var t;return this.optional(e)?!0:(t=new RegExp(n).exec(a),t&&0===t.index&&t[0].length===a.length)}),p.addMethod("nonalphamin",function(a,e,n){var t;return n&&(t=a.match(/\W/g),t=t&&t.length>=n),t}),p.methods.extension?(u.addSingleVal("accept","mimtype"),u.addSingleVal("extension","extension")):u.addSingleVal("extension","extension","accept"),u.addSingleVal("regex","pattern"),u.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"),u.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range"),u.addMinMax("minlength","minlength").addMinMax("maxlength","minlength","maxlength"),u.add("equalto",["other"],function(n){var o=r(n.element.name),d=n.params.other,s=i(d,o),l=a(n.form).find(":input").filter("[name='"+t(s)+"']")[0];e(n,"equalTo",l)}),u.add("required",function(a){("INPUT"!==a.element.tagName.toUpperCase()||"CHECKBOX"!==a.element.type.toUpperCase())&&e(a,"required",!0)}),u.add("remote",["url","type","additionalfields"],function(o){var d={url:o.params.url,type:o.params.type||"GET",data:{}},s=r(o.element.name);a.each(n(o.params.additionalfields||o.element.name),function(e,n){var r=i(n,s);d.data[r]=function(){var e=a(o.form).find(":input").filter("[name='"+t(r)+"']");return e.is(":checkbox")?e.filter(":checked").val()||e.filter(":hidden").val()||"":e.is(":radio")?e.filter(":checked").val()||"":e.val()}}),e(o,"remote",d)}),u.add("password",["min","nonalphamin","regex"],function(a){a.params.min&&e(a,"minlength",a.params.min),a.params.nonalphamin&&e(a,"nonalphamin",a.params.nonalphamin),a.params.regex&&e(a,"regex",a.params.regex)}),a(function(){p.unobtrusive.parse(document)})}(jQuery); -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_Before/AwesomeComputers/Web.config: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # except build/, which is used as an MSBuild target. 166 | !**/packages/build/ 167 | # Uncomment if necessary however generally it will be regenerated when needed 168 | #!**/packages/repositories.config 169 | # NuGet v3's project.json files produces more ignorable files 170 | *.nuget.props 171 | *.nuget.targets 172 | 173 | # Microsoft Azure Build Output 174 | csx/ 175 | *.build.csdef 176 | 177 | # Microsoft Azure Emulator 178 | ecf/ 179 | rcf/ 180 | 181 | # Windows Store app package directories and files 182 | AppPackages/ 183 | BundleArtifacts/ 184 | Package.StoreAssociation.xml 185 | _pkginfo.txt 186 | 187 | # Visual Studio cache files 188 | # files ending in .cache can be ignored 189 | *.[Cc]ache 190 | # but keep track of directories ending in .cache 191 | !*.[Cc]ache/ 192 | 193 | # Others 194 | ClientBin/ 195 | ~$* 196 | *~ 197 | *.dbmdl 198 | *.dbproj.schemaview 199 | *.jfm 200 | *.pfx 201 | *.publishsettings 202 | orleans.codegen.cs 203 | 204 | # Since there are multiple workflows, uncomment next line to ignore bower_components 205 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 206 | #bower_components/ 207 | 208 | # RIA/Silverlight projects 209 | Generated_Code/ 210 | 211 | # Backup & report files from converting an old project file 212 | # to a newer Visual Studio version. Backup files are not needed, 213 | # because we have git ;-) 214 | _UpgradeReport_Files/ 215 | Backup*/ 216 | UpgradeLog*.XML 217 | UpgradeLog*.htm 218 | 219 | # SQL Server files 220 | *.mdf 221 | *.ldf 222 | *.ndf 223 | 224 | # Business Intelligence projects 225 | *.rdl.data 226 | *.bim.layout 227 | *.bim_*.settings 228 | 229 | # Microsoft Fakes 230 | FakesAssemblies/ 231 | 232 | # GhostDoc plugin setting file 233 | *.GhostDoc.xml 234 | 235 | # Node.js Tools for Visual Studio 236 | .ntvs_analysis.dat 237 | node_modules/ 238 | 239 | # Typescript v1 declaration files 240 | typings/ 241 | 242 | # Visual Studio 6 build log 243 | *.plg 244 | 245 | # Visual Studio 6 workspace options file 246 | *.opt 247 | 248 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 249 | *.vbw 250 | 251 | # Visual Studio LightSwitch build output 252 | **/*.HTMLClient/GeneratedArtifacts 253 | **/*.DesktopClient/GeneratedArtifacts 254 | **/*.DesktopClient/ModelManifest.xml 255 | **/*.Server/GeneratedArtifacts 256 | **/*.Server/ModelManifest.xml 257 | _Pvt_Extensions 258 | 259 | # Paket dependency manager 260 | .paket/paket.exe 261 | paket-files/ 262 | 263 | # FAKE - F# Make 264 | .fake/ 265 | 266 | # JetBrains Rider 267 | .idea/ 268 | *.sln.iml 269 | 270 | # CodeRush 271 | .cr/ 272 | 273 | # Python Tools for Visual Studio (PTVS) 274 | __pycache__/ 275 | *.pyc 276 | 277 | # Cake - Uncomment if you are using it 278 | # tools/** 279 | # !tools/packages.config 280 | 281 | # Telerik's JustMock configuration file 282 | *.jmconfig 283 | 284 | # BizTalk build output 285 | *.btp.cs 286 | *.btm.cs 287 | *.odx.cs 288 | *.xsd.cs 289 | -------------------------------------------------------------------------------- /MsftBuild2018.AwesomeComputers_After/AwesomeComputers/App_Start/Startup.Auth.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Configuration; 3 | using System.Diagnostics; 4 | using System.IdentityModel.Claims; 5 | using System.Threading.Tasks; 6 | using System.Web; 7 | using AwesomeComputers.Models; 8 | using Microsoft.Identity.Client; 9 | using Microsoft.IdentityModel.Protocols.OpenIdConnect; 10 | using Microsoft.IdentityModel.Tokens; 11 | using Microsoft.Owin.Security; 12 | using Microsoft.Owin.Security.Cookies; 13 | using Microsoft.Owin.Security.Notifications; 14 | using Microsoft.Owin.Security.OpenIdConnect; 15 | using Owin; 16 | 17 | namespace AwesomeComputers 18 | { 19 | public partial class Startup 20 | { 21 | // App config settings 22 | public static string ClientId = ConfigurationManager.AppSettings["ida:ClientId"]; 23 | public static string ClientSecret = ConfigurationManager.AppSettings["ida:ClientSecret"]; 24 | public static string AadInstance = ConfigurationManager.AppSettings["ida:AadInstance"]; 25 | public static string Tenant = ConfigurationManager.AppSettings["ida:Tenant"]; 26 | public static string RedirectUri = ConfigurationManager.AppSettings["ida:RedirectUri"]; 27 | 28 | // B2C policy identifiers 29 | public static string SignUpSignInPolicyId = ConfigurationManager.AppSettings["ida:SignUpSignInPolicyId"]; 30 | public static string EditProfilePolicyId = ConfigurationManager.AppSettings["ida:EditProfilePolicyId"]; 31 | public static string ResetPasswordPolicyId = ConfigurationManager.AppSettings["ida:ResetPasswordPolicyId"]; 32 | 33 | public static string DefaultPolicy = SignUpSignInPolicyId; 34 | 35 | // OWIN auth middleware constants 36 | public const string ObjectIdElement = "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"; 37 | 38 | // Authorities 39 | public static string Authority = String.Format(AadInstance, Tenant, DefaultPolicy); 40 | 41 | /* 42 | * Configure the OWIN middleware 43 | */ 44 | public void ConfigureAuth(IAppBuilder app) 45 | { 46 | app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); 47 | 48 | app.UseCookieAuthentication(new CookieAuthenticationOptions()); 49 | 50 | app.UseOpenIdConnectAuthentication( 51 | new OpenIdConnectAuthenticationOptions 52 | { 53 | // Generate the metadata address using the tenant and policy information 54 | MetadataAddress = String.Format(AadInstance, Tenant, DefaultPolicy), 55 | 56 | // These are standard OpenID Connect parameters, with values pulled from web.config 57 | ClientId = ClientId, 58 | RedirectUri = RedirectUri, 59 | PostLogoutRedirectUri = RedirectUri, 60 | 61 | // Specify the callbacks for each type of notifications 62 | Notifications = new OpenIdConnectAuthenticationNotifications 63 | { 64 | RedirectToIdentityProvider = OnRedirectToIdentityProvider, 65 | AuthorizationCodeReceived = OnAuthorizationCodeReceived, 66 | AuthenticationFailed = OnAuthenticationFailed, 67 | }, 68 | 69 | // Specify the claim type that specifies the Name property. 70 | TokenValidationParameters = new TokenValidationParameters 71 | { 72 | NameClaimType = "name" 73 | }, 74 | 75 | // Specify the scope by appending all of the scopes requested into one string (separated by a blank space) 76 | Scope = $"openid profile offline_access" 77 | } 78 | ); 79 | } 80 | 81 | /* 82 | * On each call to Azure AD B2C, check if a policy (e.g. the profile edit or password reset policy) has been specified in the OWIN context. 83 | * If so, use that policy when making the call. Also, don't request a code (since it won't be needed). 84 | */ 85 | private Task OnRedirectToIdentityProvider(RedirectToIdentityProviderNotification notification) 86 | { 87 | var policy = notification.OwinContext.Get("Policy"); 88 | 89 | if (!string.IsNullOrEmpty(policy) && !policy.Equals(DefaultPolicy)) 90 | { 91 | notification.ProtocolMessage.Scope = OpenIdConnectScope.OpenId; 92 | notification.ProtocolMessage.ResponseType = OpenIdConnectResponseType.IdToken; 93 | notification.ProtocolMessage.IssuerAddress = notification.ProtocolMessage.IssuerAddress.ToLower().Replace(DefaultPolicy.ToLower(), policy.ToLower()); 94 | } 95 | 96 | return Task.FromResult(0); 97 | } 98 | 99 | /* 100 | * Catch any failures received by the authentication middleware and handle appropriately 101 | */ 102 | private Task OnAuthenticationFailed(AuthenticationFailedNotification notification) 103 | { 104 | notification.HandleResponse(); 105 | 106 | // Handle the error code that Azure AD B2C throws when trying to reset a password from the login page 107 | // because password reset is not supported by a "sign-up or sign-in policy" 108 | if (notification.ProtocolMessage.ErrorDescription != null && notification.ProtocolMessage.ErrorDescription.Contains("AADB2C90118")) 109 | { 110 | // If the user clicked the reset password link, redirect to the reset password route 111 | notification.Response.Redirect("/Account/ResetPassword"); 112 | } 113 | else if (notification.Exception.Message == "access_denied") 114 | { 115 | notification.Response.Redirect("/"); 116 | } 117 | else 118 | { 119 | notification.Response.Redirect("/Home/Error?message=" + notification.Exception.Message); 120 | } 121 | 122 | return Task.FromResult(0); 123 | } 124 | 125 | 126 | /* 127 | * Callback function when an authorization code is received 128 | */ 129 | private async Task OnAuthorizationCodeReceived(AuthorizationCodeReceivedNotification notification) 130 | { 131 | // Extract the code from the response notification 132 | var code = notification.Code; 133 | 134 | string signedInUserID = notification.AuthenticationTicket.Identity.FindFirst(ClaimTypes.NameIdentifier).Value; 135 | TokenCache userTokenCache = new MSALSessionCache(signedInUserID, notification.OwinContext.Environment["System.Web.HttpContextBase"] as HttpContextBase).GetMsalCacheInstance(); 136 | ConfidentialClientApplication cca = new ConfidentialClientApplication(ClientId, Authority, RedirectUri, new ClientCredential(ClientSecret), userTokenCache, null); 137 | try 138 | { 139 | AuthenticationResult result = await cca.AcquireTokenByAuthorizationCodeAsync(code, new [] { string.Empty }); 140 | Trace.WriteLine($"Code: '{code}', Token: '{result.AccessToken}'"); 141 | } 142 | catch (Exception ex) 143 | { 144 | //TODO: Handle 145 | throw; 146 | } 147 | } 148 | } 149 | } 150 | --------------------------------------------------------------------------------