Skip to content

Commit e52f73f

Browse files
authored
[Microsoft Entra ID] az ad app create/update: Add --requested-access-token-version argument (#30230)
1 parent f499bfa commit e52f73f

File tree

7 files changed

+333
-280
lines changed

7 files changed

+333
-280
lines changed

src/azure-cli/azure/cli/command_modules/role/_msgrpah/_graph_objects.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
'sign_in_audience': 'signInAudience',
1616
'service_management_reference': 'serviceManagementReference',
1717
'key_credentials': 'keyCredentials',
18+
# api
19+
'requested_access_token_version': ['api', 'requestedAccessTokenVersion'],
1820
# web
1921
'web_home_page_url': ['web', 'homePageUrl'],
2022
'web_redirect_uris': ['web', 'redirectUris'],

src/azure-cli/azure/cli/command_modules/role/_params.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def load_arguments(self, _):
3030
help='list all entities, expect long delay if under a big organization')
3131

3232
with self.argument_context('ad app') as c:
33+
# https://learn.microsoft.com/en-us/graph/api/resources/application?view=graph-rest-1.0
3334
c.argument('app_id', help='application id')
3435
c.argument('application_object_id', options_list=('--object-id',))
3536
c.argument('display_name', help='the display name of the application')
@@ -55,7 +56,15 @@ def load_arguments(self, _):
5556
'PersonalMicrosoftAccount']),
5657
help='Specifies the Microsoft accounts that are supported for the current application.')
5758

59+
# api
60+
# https://learn.microsoft.com/en-us/graph/api/resources/apiapplication?view=graph-rest-1.0
61+
c.argument('requested_access_token_version', arg_group='api', type=int,
62+
help='Specifies the access token version expected by this resource. This changes the version and '
63+
'format of the JWT produced independent of the endpoint or client used to request the access '
64+
'token.')
65+
5866
# web
67+
# https://learn.microsoft.com/en-us/graph/api/resources/webapplication?view=graph-rest-1.0
5968
c.argument('web_home_page_url', arg_group='web', help='Home page or landing page of the application.')
6069
c.argument('web_redirect_uris', arg_group='web', nargs='+',
6170
help='Space-separated values. '
@@ -71,12 +80,14 @@ def load_arguments(self, _):
7180
'implicit flow.')
7281

7382
# publicClient
83+
# https://learn.microsoft.com/en-us/graph/api/resources/publicclientapplication?view=graph-rest-1.0
7484
c.argument('public_client_redirect_uris', arg_group='publicClient', nargs='+',
7585
help='Space-separated values. '
7686
'Specifies the URLs where user tokens are sent for sign-in, or the redirect URIs '
7787
'where OAuth 2.0 authorization codes and access tokens are sent.')
7888

7989
# keyCredential
90+
# https://learn.microsoft.com/en-us/graph/api/resources/keycredential?view=graph-rest-1.0
8091
c.argument('start_date', arg_group='keyCredential',
8192
help="Date or datetime at which credentials become valid (e.g. '2017-01-01T01:00:00+00:00' or "
8293
"'2017-01-01'). Default value is current time")

src/azure-cli/azure/cli/command_modules/role/custom.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ def create_application(cmd, client, display_name, identifier_uris=None,
631631
is_fallback_public_client=None,
632632
service_management_reference=None,
633633
sign_in_audience=None,
634+
# api
635+
requested_access_token_version=None,
634636
# keyCredentials
635637
key_value=None, key_type=None, key_usage=None, start_date=None, end_date=None,
636638
key_display_name=None,
@@ -660,6 +662,8 @@ def create_application(cmd, client, display_name, identifier_uris=None,
660662
is_fallback_public_client=is_fallback_public_client,
661663
service_management_reference=service_management_reference,
662664
sign_in_audience=sign_in_audience,
665+
# api
666+
requested_access_token_version=requested_access_token_version,
663667
# keyCredentials
664668
key_value=key_value, key_type=key_type, key_usage=key_usage,
665669
start_date=start_date, end_date=end_date,
@@ -691,6 +695,8 @@ def create_application(cmd, client, display_name, identifier_uris=None,
691695
is_fallback_public_client=is_fallback_public_client,
692696
service_management_reference=service_management_reference,
693697
sign_in_audience=sign_in_audience,
698+
# api
699+
requested_access_token_version=requested_access_token_version,
694700
# keyCredentials
695701
key_credentials=key_credentials,
696702
# web
@@ -718,6 +724,8 @@ def update_application(instance, display_name=None, identifier_uris=None, # pyl
718724
is_fallback_public_client=None,
719725
service_management_reference=None,
720726
sign_in_audience=None,
727+
# api
728+
requested_access_token_version=None,
721729
# keyCredentials
722730
key_value=None, key_type=None, key_usage=None, start_date=None, end_date=None,
723731
key_display_name=None,
@@ -741,6 +749,8 @@ def update_application(instance, display_name=None, identifier_uris=None, # pyl
741749
is_fallback_public_client=is_fallback_public_client,
742750
service_management_reference=service_management_reference,
743751
sign_in_audience=sign_in_audience,
752+
# api
753+
requested_access_token_version=requested_access_token_version,
744754
# keyCredentials
745755
key_credentials=key_credentials,
746756
# web

src/azure-cli/azure/cli/command_modules/role/linter_exclusions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ ad app create:
1818
service_management_reference:
1919
rule_exclusions:
2020
- option_length_too_long
21+
requested_access_token_version:
22+
rule_exclusions:
23+
- option_length_too_long
2124
ad app update:
2225
parameters:
2326
enable_access_token_issuance:
@@ -35,6 +38,9 @@ ad app update:
3538
service_management_reference:
3639
rule_exclusions:
3740
- option_length_too_long
41+
requested_access_token_version:
42+
rule_exclusions:
43+
- option_length_too_long
3844
ad user create:
3945
parameters:
4046
force_change_password_next_sign_in:

0 commit comments

Comments
 (0)