[Core] Support Continuous Access Evaluation - #23635
Merged
Merged
Conversation
ghost
requested a review
from Yong Zhang (yonzhan)
August 23, 2022 08:21
ghost
requested a review
from ZelinWang (wangzelin007)
August 23, 2022 08:21
ghost
requested review from
Zhiyi Huang (calvinhzy) and
Yishi Wang (evelyn-ys)
August 23, 2022 08:21
Contributor
Author
|
I accidentally bumped into a scenario where silent re-auth works, without interactive re-auth: > az login
# Switch to a tenant 54826b22-38d6-4fb2-bad9-b7b93a3e9c5a where I am a guest
> az account set -s 0b1f6471-1bf0-4dda-aec3-cb9272f09590
# Revoke all sessions
> az rest -m POST -u https://graph.microsoft.com/v1.0/me/revokeSignInSessions
> az group list > $null
WARNING: Acquiring new access token silently for tenant 54826b22-38d6-4fb2-bad9-b7b93a3e9c5a with claims challenge: {"access_token":{"nbf":{"essential":true, "value":"1661243399"}}}I guess it is because I didn't revoke sessions in home tenant |
Contributor
Author
|
The implementation with |
Jiashuo Li (jiasli)
force-pushed
the
cae
branch
from
August 30, 2022 04:23
bf6280e to
fbf3796
Compare
Jiashuo Li (jiasli)
force-pushed
the
cae
branch
from
August 30, 2022 04:26
fbf3796 to
0564fee
Compare
Jiashuo Li (jiasli)
marked this pull request as ready for review
September 5, 2022 05:30
Jiashuo Li (jiasli)
requested review from
Yu Chen (jsntcy),
kai ru (kairu-ms),
Ethan Yang (necusjz) and
Xing Zhou (zhoxing-ms)
as code owners
September 5, 2022 05:30
| result = self.cmd('account get-access-token').get_output_in_json() | ||
| access_token = result['accessToken'] | ||
| decoded = decode_access_token(access_token) | ||
| self.assertEqual(decoded['xms_cc'], ['CP1']) # xms_cc: extension microsoft client capabilities |
Contributor
Author
There was a problem hiding this comment.
It seems xms_ssm claims is dropped from GA version of CAE, so this test is no longer needed:
self.assertEqual(decoded['xms_ssm'], '1') # xms_ssm: extension microsoft smart session management
Yong Zhang (yonzhan)
approved these changes
Sep 5, 2022
Yishi Wang (evelyn-ys)
approved these changes
Sep 5, 2022
3 tasks
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Close #21296
Support Continuous Access Evaluation. For details of CAE, see
Testing Guide
az loginnow passesCP1client capability to MSAL and AAD eSTS server:Decode the retrieved access token at https://jwt.ms/ to verify it has
CP1inxms_cc:Revoke all sessions:
Retry calling ARM until failure:
Log in again with the returned claims challenge:
Additional information
However, as explained in #21296 (comment), according to AAD document:
https://docs.microsoft.com/en-us/azure/active-directory/develop/app-resilience-continuous-access-evaluation#the-code
claims challenge should be sent back to interactive re-auth. But Azure PowerShell cmdlet
Connect-AzAccountdoesn't expose-Claimsparameter, and everything still works as expected.We still need to decide whether Azure CLI wants to expose
--claimsinaz login.2022-08-33 Update
As discussed with Azure PowerShell, Azure CLI will not support
--claimsfor now until further required.Azure CLI will support
AZURE_IDENTITY_DISABLE_CP1to align with Azure PowerShell, .NET Azure Identity SDK and Python Azure Identity SDK.