-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3838 from AzureAD/ropc-cca-support
ROPC added for confidential clients
- Loading branch information
Showing
12 changed files
with
162 additions
and
45 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-common-dc2c24bd-f38c-4580-ba04-b44ee8ac5b9f.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "Adding ROPC for confidential client apps (#3838)", | ||
"packageName": "@azure/msal-common", | ||
"email": "sameera.gajjarapu@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-node-c1284212-4af4-45ff-829d-e7c277947e88.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "minor", | ||
"comment": "ROPC added for Confidential Clients (#3838)", | ||
"packageName": "@azure/msal-node", | ||
"email": "sameera.gajjarapu@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. | ||
*/ | ||
|
||
var msal = require("@azure/msal-node"); | ||
|
||
const msalConfig = { | ||
auth: { | ||
clientId: "", // Enter your client_id here | ||
authority: "", // Enter your authority here | ||
clientSecret: "" // Enter your client_secret here | ||
} | ||
}; | ||
|
||
const cca = new msal.ConfidentialClientApplication(msalConfig); | ||
|
||
const usernamePasswordRequest = { | ||
scopes: ["user.read"], | ||
username: "", // Add your username here | ||
password: "", // Add your password here | ||
}; | ||
|
||
cca.acquireTokenByUsernamePassword(usernamePasswordRequest).then((response) => { | ||
console.log("acquired token by password grant in confidential clients"); | ||
}).catch((error) => { | ||
console.log(error); | ||
}); | ||
|
||
|
||
|
18 changes: 18 additions & 0 deletions
18
samples/msal-node-samples/username-password-cca/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "msal-node-username-password-cca", | ||
"version": "1.0.0", | ||
"description": "Command line app that uses Oauth password grant flow to get a token from Azure AD", | ||
"main": "index.js", | ||
"private": true, | ||
"scripts": { | ||
"start": "node index.js", | ||
"build:package": "cd ../../lib/msal-common && npm run build && cd ../msal-node && npm run build", | ||
"start:build": "npm run build:package && npm start", | ||
"install:local": "npm install ../../../lib/msal-node" | ||
}, | ||
"author": "Microsoft", | ||
"license": "MIT", | ||
"dependencies": { | ||
"@azure/msal-node": "file:../../../lib/msal-node" | ||
} | ||
} |