-
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.
Support pop as optional for full framed apps (#7119)
- This PR signs the POP tokens only if the reqCnf is not passed in as a request parameter. This is to enable any clients that choose to sign their tokens. However, please consider this an advanced feature only. - This PR also addresses the native flow bug where cnf is to be sent a string instead of a hash! - Removes reqCnfHash in the ReqCnfData since we do not use it. It is only internal, so this should not be a breaking change. --------- Co-authored-by: Thomas Norling <[email protected]> Co-authored-by: Lalima Sharda <[email protected]> Co-authored-by: Hector Morales <[email protected]>
- Loading branch information
1 parent
7563498
commit 25aefea
Showing
44 changed files
with
633 additions
and
66 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-browser-6d89bcc9-48e1-495e-bdd5-2d7fda8e13f8.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": "Add support for apps to set their own `reqCnf` and correct native flows cnf format #6357", | ||
"packageName": "@azure/msal-browser", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-common-98b3791f-fcf5-4225-a03c-a379d2312455.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": "Add support for apps to set their own `reqCnf` and correct native flows cnf format #6357", | ||
"packageName": "@azure/msal-common", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@azure-msal-node-cf83856a-c1aa-4763-8eb2-0b62f5708a27.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": "patch", | ||
"comment": "Fixed msal-node unit tests for PoP token support #\u0016\u00167119", | ||
"packageName": "@azure/msal-node", | ||
"email": "[email protected]", | ||
"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 |
---|---|---|
|
@@ -22,6 +22,7 @@ import { | |
TEST_URIS, | ||
DEFAULT_TENANT_DISCOVERY_RESPONSE, | ||
DEFAULT_OPENID_CONFIG_RESPONSE, | ||
TEST_REQ_CNF_DATA, | ||
} from "../utils/StringConstants"; | ||
import { AuthorizationUrlRequest } from "../../src/request/AuthorizationUrlRequest"; | ||
import { RedirectRequest } from "../../src/request/RedirectRequest"; | ||
|
@@ -141,6 +142,56 @@ describe("StandardInteractionClient", () => { | |
await testClient.initializeAuthorizationCodeRequest(request); | ||
expect(request.codeChallenge).toBe(TEST_CONFIG.TEST_CHALLENGE); | ||
expect(authCodeRequest.codeVerifier).toBe(TEST_CONFIG.TEST_VERIFIER); | ||
expect(authCodeRequest.popKid).toBeUndefined; | ||
}); | ||
|
||
it("initializeAuthorizationCodeRequest validates the request and does not influence undefined popKid param", async () => { | ||
const request: AuthorizationUrlRequest = { | ||
redirectUri: TEST_URIS.TEST_REDIR_URI, | ||
scopes: ["scope"], | ||
loginHint: "[email protected]", | ||
state: TEST_STATE_VALUES.USER_STATE, | ||
authority: TEST_CONFIG.validAuthority, | ||
correlationId: TEST_CONFIG.CORRELATION_ID, | ||
responseMode: TEST_CONFIG.RESPONSE_MODE as ResponseMode, | ||
nonce: "", | ||
authenticationScheme: | ||
TEST_CONFIG.TOKEN_TYPE_BEARER as AuthenticationScheme, | ||
}; | ||
|
||
jest.spyOn(PkceGenerator, "generatePkceCodes").mockResolvedValue({ | ||
challenge: TEST_CONFIG.TEST_CHALLENGE, | ||
verifier: TEST_CONFIG.TEST_VERIFIER, | ||
}); | ||
|
||
const authCodeRequest = | ||
await testClient.initializeAuthorizationCodeRequest(request); | ||
expect(authCodeRequest.popKid).toBeUndefined; | ||
}); | ||
|
||
it("initializeAuthorizationCodeRequest validates the request and adds reqCnf param when user defined", async () => { | ||
const request: AuthorizationUrlRequest = { | ||
redirectUri: TEST_URIS.TEST_REDIR_URI, | ||
scopes: ["scope"], | ||
loginHint: "[email protected]", | ||
state: TEST_STATE_VALUES.USER_STATE, | ||
authority: TEST_CONFIG.validAuthority, | ||
correlationId: TEST_CONFIG.CORRELATION_ID, | ||
responseMode: TEST_CONFIG.RESPONSE_MODE as ResponseMode, | ||
nonce: "", | ||
authenticationScheme: | ||
TEST_CONFIG.TOKEN_TYPE_BEARER as AuthenticationScheme, | ||
popKid: TEST_REQ_CNF_DATA.kid, | ||
}; | ||
|
||
jest.spyOn(PkceGenerator, "generatePkceCodes").mockResolvedValue({ | ||
challenge: TEST_CONFIG.TEST_CHALLENGE, | ||
verifier: TEST_CONFIG.TEST_VERIFIER, | ||
}); | ||
|
||
const authCodeRequest = | ||
await testClient.initializeAuthorizationCodeRequest(request); | ||
expect(authCodeRequest.popKid).toEqual(TEST_REQ_CNF_DATA.kid); | ||
}); | ||
|
||
it("getDiscoveredAuthority - request authority only", async () => { | ||
|
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
Oops, something went wrong.