-
Goodbye!
-
You have signed out and your cache has been cleared.
-
Take me back
-
-
-
\ No newline at end of file
diff --git a/1-Authentication/2-sign-in-b2c/App/styles.css b/1-Authentication/2-sign-in-b2c/App/styles.css
deleted file mode 100644
index 4a5d384..0000000
--- a/1-Authentication/2-sign-in-b2c/App/styles.css
+++ /dev/null
@@ -1,14 +0,0 @@
-.navbarStyle {
- padding: .5rem 1rem !important;
-}
-
-.profileButton {
- margin: .5rem .5rem;
-}
-
-
-.table-responsive-ms {
- max-height: 39rem !important;
- margin-left: 1.5rem;
- margin-right: 1.5rem;
-}
\ No newline at end of file
diff --git a/1-Authentication/2-sign-in-b2c/App/ui.js b/1-Authentication/2-sign-in-b2c/App/ui.js
deleted file mode 100644
index eb78356..0000000
--- a/1-Authentication/2-sign-in-b2c/App/ui.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Select DOM elements to work with
-const signInButton = document.getElementById('signIn');
-const signOutButton = document.getElementById('signOut')
-const titleDiv = document.getElementById('title-div');
-const welcomeDiv = document.getElementById('welcome-div');
-const tableDiv = document.getElementById('table-div');
-const tableBody = document.getElementById('table-body-div');
-const footerDiv = document.getElementById('footer');
-const editProfileButton = document.getElementById('editProfileButton');
-const table = document.getElementById('table');
-
-function welcomeUser(username) {
-
- signInButton.classList.add('d-none');
- signOutButton.classList.remove('d-none');
- titleDiv.classList.add('d-none');
- editProfileButton.classList.remove('d-none');
- welcomeDiv.classList.remove('d-none');
- welcomeDiv.innerHTML = `Welcome ${username}!`
- table.style.overflow = 'scroll';
-}
-
-function updateTable(idTokenClaims) {
- tableDiv.classList.remove('d-none');
- footerDiv.classList.remove('d-none');
- const tokenClaims = createClaimsTable(idTokenClaims);
- Object.keys(tokenClaims).forEach((key) => {
- let row = tableBody.insertRow(0);
- let cell1 = row.insertCell(0);
- let cell2 = row.insertCell(1);
- let cell3 = row.insertCell(2);
- cell1.innerHTML = tokenClaims[key][0];
- cell2.innerHTML = tokenClaims[key][1];
- cell3.innerHTML = tokenClaims[key][2];
- })
-
-}
\ No newline at end of file
diff --git a/1-Authentication/2-sign-in-b2c/App/utils/claimUtils.js b/1-Authentication/2-sign-in-b2c/App/utils/claimUtils.js
deleted file mode 100644
index 1638b14..0000000
--- a/1-Authentication/2-sign-in-b2c/App/utils/claimUtils.js
+++ /dev/null
@@ -1,224 +0,0 @@
-/**
- * Populate claims table with appropriate description
- * @param {Object} claims ID token claims
- * @returns claimsObject
- */
-const createClaimsTable = (claims) => {
- let claimsObj = {};
- let index = 0;
-
- Object.keys(claims).forEach((key) => {
- if (typeof claims[key] !== 'string' && typeof claims[key] !== 'number') return;
- switch (key) {
- case 'aud':
- populateClaim(
- key,
- claims[key],
- "Identifies the intended recipient of the token. In ID tokens, the audience is your app's Application ID, assigned to your app in the Azure portal.",
- index,
- claimsObj
- );
- index++;
- break;
- case 'iss':
- populateClaim(
- key,
- claims[key],
- 'Identifies the issuer, or authorization server that constructs and returns the token. It also identifies the Azure AD tenant for which the user was authenticated. If the token was issued by the v2.0 endpoint, the URI will end in /v2.0. The GUID that indicates that the user is a consumer user from a Microsoft account is 9188040d-6c67-4c5b-b112-36a304b66dad.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'iat':
- populateClaim(
- key,
- changeDateFormat(claims[key]),
- 'Issued At indicates when the authentication for this token occurred.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'nbf':
- populateClaim(
- key,
- changeDateFormat(claims[key]),
- 'The nbf (not before) claim identifies the time (as UNIX timestamp) before which the JWT must not be accepted for processing.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'exp':
- populateClaim(
- key,
- changeDateFormat(claims[key]),
- "The exp (expiration time) claim identifies the expiration time (as UNIX timestamp) on or after which the JWT must not be accepted for processing. It's important to note that in certain circumstances, a resource may reject the token before this time. For example, if a change in authentication is required or a token revocation has been detected.",
- index,
- claimsObj
- );
- index++;
- break;
- case 'name':
- populateClaim(
- key,
- claims[key],
- "The principal about which the token asserts information, such as the user of an application. This value is immutable and can't be reassigned or reused. It can be used to perform authorization checks safely, such as when the token is used to access a resource. By default, the subject claim is populated with the object ID of the user in the directory",
- index,
- claimsObj
- );
- index++;
- break;
- case 'preferred_username':
- populateClaim(
- key,
- claims[key],
- 'The primary username that represents the user. It could be an email address, phone number, or a generic username without a specified format. Its value is mutable and might change over time. Since it is mutable, this value must not be used to make authorization decisions. It can be used for username hints, however, and in human-readable UI as a username. The profile scope is required in order to receive this claim.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'nonce':
- populateClaim(
- key,
- claims[key],
- 'The nonce matches the parameter included in the original /authorize request to the IDP. If it does not match, your application should reject the token.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'oid':
- populateClaim(
- key,
- claims[key],
- 'The oid (user’s object id) is the only claim that should be used to uniquely identify a user in an Azure AD tenant. The token might have one or more of the following claim, that might seem like a unique identifier, but is not and should not be used as such.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'tid':
- populateClaim(
- key,
- claims[key],
- 'The tenant ID. You will use this claim to ensure that only users from the current Azure AD tenant can access this app.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'upn':
- populateClaim(
- key,
- claims[key],
- '(user principal name) – might be unique amongst the active set of users in a tenant but tend to get reassigned to new employees as employees leave the organization and others take their place or might change to reflect a personal change like marriage.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'email':
- populateClaim(
- key,
- claims[key],
- 'Email might be unique amongst the active set of users in a tenant but tend to get reassigned to new employees as employees leave the organization and others take their place.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'acct':
- populateClaim(
- key,
- claims[key],
- 'Available as an optional claim, it lets you know what the type of user (homed, guest) is. For example, for an individual’s access to their data you might not care for this claim, but you would use this along with tenant id (tid) to control access to say a company-wide dashboard to just employees (homed users) and not contractors (guest users).',
- index,
- claimsObj
- );
- index++;
- break;
- case 'sid':
- populateClaim(key, claims[key], 'Session ID, used for per-session user sign-out.', index, claimsObj);
- index++;
- break;
- case 'sub':
- populateClaim(
- key,
- claims[key],
- 'The sub claim is a pairwise identifier - it is unique to a particular application ID. If a single user signs into two different apps using two different client IDs, those apps will receive two different values for the subject claim.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'ver':
- populateClaim(
- key,
- claims[key],
- 'Version of the token issued by the Microsoft identity platform',
- index,
- claimsObj
- );
- index++;
- break;
- case 'auth_time':
- populateClaim(
- key,
- claims[key],
- 'The time at which a user last entered credentials, represented in epoch time. There is no discrimination between that authentication being a fresh sign-in, a single sign-on (SSO) session, or another sign-in type.',
- index,
- claimsObj
- );
- index++;
- break;
- case 'at_hash':
- populateClaim(
- key,
- claims[key],
- 'An access token hash included in an ID token only when the token is issued together with an OAuth 2.0 access token. An access token hash can be used to validate the authenticity of an access token',
- index,
- claimsObj
- );
- index++;
- break;
- case 'uti':
- case 'rh':
- index++;
- break;
- default:
- populateClaim(key, claims[key], '', index, claimsObj);
- index++;
- }
- });
-
- return claimsObj;
-};
-
-/**
- * Populates claim, description, and value into an claimsObject
- * @param {String} claim
- * @param {String} value
- * @param {String} description
- * @param {Number} index
- * @param {Object} claimsObject
- */
-const populateClaim = (claim, value, description, index, claimsObject) => {
- let claimsArray = [];
- claimsArray[0] = claim;
- claimsArray[1] = value;
- claimsArray[2] = description;
- claimsObject[index] = claimsArray;
-};
-
-/**
- * Transforms Unix timestamp to date and returns a string value of that date
- * @param {String} date Unix timestamp
- * @returns
- */
-const changeDateFormat = (date) => {
- let dateObj = new Date(date * 1000);
- return `${date} - [${dateObj.toString()}]`;
-};
\ No newline at end of file
diff --git a/1-Authentication/2-sign-in-b2c/AppCreationScripts/sample.json b/1-Authentication/2-sign-in-b2c/AppCreationScripts/sample.json
deleted file mode 100644
index 6ac9f13..0000000
--- a/1-Authentication/2-sign-in-b2c/AppCreationScripts/sample.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "Sample": {
- "Title": "Vanilla JavaScript single-page application (SPA) using MSAL.js to authenticate users against Azure AD B2C",
- "Level": 100,
- "Client": "Vanilla JavaScript SPA",
- "RepositoryUrl": "ms-identity-javascript-tutorial",
- "Endpoint": "AAD v2.0",
- "Languages": ["javascript"],
- "Description": "Vanilla JavaScript single-page application (SPA) using MSAL.js to authenticate users against Azure AD B2C",
- "Products": ["azure-active-directory-b2c", "msal-js", "msal-browser"],
- "Platform": "JavaScript",
- "Provider": "B2C"
- },
-
- "AADApps": [
- {
- "Id": "client",
- "Name": "ms-identity-javascript-c1s2",
- "Kind": "SinglePageApplication",
- "Audience": "AzureADandPersonalMicrosoftAccount",
- "HomePage": "http://localhost:6420",
- "SampleSubPath": "1-Authentication\\2-sign-in-b2c",
- "ReplyUrls": "http://localhost:6420, http://localhost:6420/redirect"
- }
- ],
- "CodeConfiguration": [
- {
- "App": "client",
- "SettingKind": "Replace",
- "SettingFile": "\\..\\App\\src\\authConfig.js",
- "Mappings": [
- {
- "key": "Enter_the_Application_Id_Here",
- "value": ".AppId"
- },
- {
- "key": "policyName",
- "value": "Enter_The_Your_policy_Name"
- },
- {
- "key": "b2cDomain",
- "value": "Enter_The_Tenant_Domain_name"
- }
- ]
- }
- ]
-}
diff --git a/1-Authentication/2-sign-in-b2c/README.md b/1-Authentication/2-sign-in-b2c/README.md
deleted file mode 100644
index ecce84b..0000000
--- a/1-Authentication/2-sign-in-b2c/README.md
+++ /dev/null
@@ -1,391 +0,0 @@
----
-page_type: sample
-name: Vanilla JavaScript single-page application (SPA) using MSAL.js to authenticate users against Azure AD B2C
-description: Vanilla JavaScript single-page application (SPA) using MSAL.js to authenticate users against Azure AD B2C
-languages:
- - javascript
-products:
- - azure-active-directory-b2c
- - msal-js
- - msal-browser
-urlFragment: ms-identity-javascript-tutorial
-extensions:
-- services: ms-identity
-- platform: JavaScript
-- endpoint: AAD v2.0
-- level: 100
-- client: Vanilla JavaScript SPA
----
-
-# Vanilla JavaScript single-page application (SPA) using MSAL.js to authenticate users against Azure AD B2C
-
-* [Overview](#overview)
-* [Scenario](#scenario)
-* [Contents](#contents)
-* [Prerequisites](#prerequisites)
-* [Setup the sample](#setup-the-sample)
-* [Explore the sample](#explore-the-sample)
-* [Troubleshooting](#troubleshooting)
-* [About the code](#about-the-code)
-* [Next Steps](#next-steps)
-* [Contributing](#contributing)
-* [Learn More](#learn-more)
-
-## Overview
-
-This sample demonstrates a Vanilla JavaScript single-page application (SPA) that lets users sign-in with [Azure Active Directory B2C](https://azure.microsoft.com/services/active-directory/external-identities/b2c/) using the [Microsoft Authentication Library for JavaScript)](https://github.com/AzureAD/microsoft-authentication-library-for-js) (MSAL.js). In doing so, it also illustrates various authentication and **B2C** concepts, such as [ID tokens](https://docs.microsoft.com/azure/active-directory-b2c/tokens-overview#token-types), [external identity providers](https://docs.microsoft.com/azure/active-directory-b2c/technical-overview#external-identity-providers) , [consumer social accounts](https://docs.microsoft.com/azure/active-directory-b2c/technical-overview#consumer-accounts), [single-sign on (SSO)](https://docs.microsoft.com/azure/active-directory-b2c/session-overview), **account selection**, **silent requests** and more.
-
-## Scenario
-
-1. The client application uses **MSAL.js** to obtain an **ID Token** from **Azure AD B2C**.
-2. The **ID Token** proves that the user has successfully authenticated against **Azure AD B2C**.
-
-
-
-## Contents
-
-| File/folder | Description |
-|-----------------------|---------------------------------------------------------------------------|
-| `App/authPopup.js` | Main authentication logic resides here (using popup flow). |
-| `App/authRedirect.js` | Use this instead of `authPopup.js` for authentication with redirect flow. |
-| `App/authConfig.js` | Contains configuration parameters for the sample. |
-| `App/ui.js` | Contains UI logic. |
-| `server.js` | Simple Node server to `index.html`. |
-
-## Prerequisites
-
-* [Node.js](https://nodejs.org/en/download/) must be installed to run this sample.
-* [Visual Studio Code](https://code.visualstudio.com/download) is recommended for running and editing this sample.
-* [VS Code Azure Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-node-azure-pack) extension is recommended for interacting with Azure through VS Code Interface.
-* A modern web browser.
-* An **Azure AD B2C** tenant. For more information, see: [How to get an Azure AD B2C tenant](https://docs.microsoft.com/azure/active-directory-b2c/tutorial-create-tenant)
-* A user account in your **Azure AD B2C** tenant.
-
-## Setup the sample
-
-### Step 1: Clone or download this repository
-
-From your shell or command line:
-
-```console
-git clone https://github.com/Azure-Samples/ms-identity-javascript-tutorial.git
-```
-
-or download and extract the repository *.zip* file.
-
-> :warning: To avoid path length limitations on Windows, we recommend cloning into a directory near the root of your drive.
-
-### Step 2: Install project dependencies
-
-```console
- cd 1-Authentication\2-sign-in-b2c
- npm install
-```
-
-### Step 3: Register the sample application(s) in your tenant
-
-> :warning: This sample comes with a pre-registered application for demo purposes. If you would like to use your own **Azure AD B2C** tenant and application, follow the steps below to register and configure the application on **Azure portal**. Otherwise, continue with the steps for [Running the sample](#step-4-running-the-sample).
-
-* follow the steps below for manually register your apps
-
-#### Choose the Azure AD B2C tenant where you want to create your applications
-
-To manually register the apps, as a first step you'll need to:
-
-1. Sign in to the [Azure portal](https://portal.azure.com).
-1. If your account is present in more than one Azure AD B2C tenant, select your profile at the top right corner in the menu on top of the page, and then **switch directory** to change your portal session to the desired Azure AD B2C tenant.
-
-#### Create User Flows and Custom Policies
-
-Please refer to: [Tutorial: Create userflows in Azure Active Directory B2C](https://docs.microsoft.com/azure/active-directory-b2c/tutorial-create-user-flows)
-
-> :warning: This sample requires B2C user-flows to emit the **emails** claim in the ID token, which is used as **username** by MSAL. To do so, navigate to the [Azure portal](https://portal.azure.com) and locate the **Azure AD B2C** service. Then, navigate to the **User flows** blade. Select the **User Attributes** tab and make sure **Email Address** is checked. Then select the **Application Claims** tab and make sure **Email Addresses** is checked.
->
-> You may want additional claims (such as **object ID** (*oid*) and etc.) to appear in the ID tokens obtained from Azure AD B2C user-flows. In that case, please refer to [User profile attributes](https://learn.microsoft.com/azure/active-directory-b2c/user-profile-attributes) to learn about how to configure your user-flows to emit those claims.
-
-#### Add External Identity Providers
-
-Please refer to: [Tutorial: Add identity providers to your applications in Azure Active Directory B2C](https://docs.microsoft.com/azure/active-directory-b2c/tutorial-add-identity-providers)
-
-#### Register the client app (ms-identity-javascript-c1s2)
-
-1. Navigate to the [Azure portal](https://portal.azure.com) and select the **Azure Active Directory B2C** service.
-1. Select the **App Registrations** blade on the left, then select **New registration**.
-1. In the **Register an application page** that appears, enter your application's registration information:
- 1. In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `ms-identity-javascript-c1s2`.
- 1. Under **Supported account types**, select **Accounts in any identity provider or organizational directory (for authenticating users with user flows)**
- 1. Select **Register** to create the application.
-1. In the **Overview** blade, find and note the **Application (client) ID**. You use this value in your app's configuration file(s) later in your code.
-1. In the app's registration screen, select the **Authentication** blade to the left.
-1. If you don't have a platform added, select **Add a platform** and select the **Single-page application** option.
- 1. In the **Redirect URI** section enter the following redirect URIs:
- 1. `http://localhost:6420`
- 1. `http://localhost:6420/redirect`
- 1. Click **Save** to save your changes.
-
-##### Configure the client app (ms-identity-javascript-c1s2) to use your app registration
-
-Open the project in your IDE (like Visual Studio or Visual Studio Code) to configure the code.
-
-> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
-
-1. Open the `App\authConfig.js` file.
-1. Find the key `clientId` and replace the existing value with the application ID (clientId) of `ms-identity-javascript-c1s2` app copied from the Azure portal.
-
-To setup your B2C user-flows, do the following:
-
-1. Find the key `names` and populate it with your policy names e.g. `signUpSignIn`.
-1. Find the key `authorities` and populate it with your policy authority strings e.g. `https://