@@ -24,6 +24,7 @@ interface Options extends GlobalOptions {
24
24
certificateFile ?: string ;
25
25
certificateBase64Encoded ?: string ;
26
26
certificateDisplayName ?: string ;
27
+ allowPublicClientFlows ?: boolean ;
27
28
}
28
29
29
30
class EntraAppSetCommand extends GraphCommand {
@@ -48,6 +49,7 @@ class EntraAppSetCommand extends GraphCommand {
48
49
this . #initOptions( ) ;
49
50
this . #initValidators( ) ;
50
51
this . #initOptionSets( ) ;
52
+ this . #initTypes( ) ;
51
53
}
52
54
53
55
#initTelemetry( ) : void {
@@ -62,7 +64,8 @@ class EntraAppSetCommand extends GraphCommand {
62
64
uris : typeof args . options . uris !== 'undefined' ,
63
65
certificateFile : typeof args . options . certificateFile !== 'undefined' ,
64
66
certificateBase64Encoded : typeof args . options . certificateBase64Encoded !== 'undefined' ,
65
- certificateDisplayName : typeof args . options . certificateDisplayName !== 'undefined'
67
+ certificateDisplayName : typeof args . options . certificateDisplayName !== 'undefined' ,
68
+ allowPublicClientFlows : typeof args . options . allowPublicClientFlows !== 'undefined'
66
69
} ) ;
67
70
} ) ;
68
71
}
@@ -81,7 +84,11 @@ class EntraAppSetCommand extends GraphCommand {
81
84
option : '--platform [platform]' ,
82
85
autocomplete : EntraAppSetCommand . aadApplicationPlatform
83
86
} ,
84
- { option : '--redirectUrisToRemove [redirectUrisToRemove]' }
87
+ { option : '--redirectUrisToRemove [redirectUrisToRemove]' } ,
88
+ {
89
+ option : '--allowPublicClientFlows [allowPublicClientFlows]' ,
90
+ autocomplete : [ 'true' , 'false' ]
91
+ }
85
92
) ;
86
93
}
87
94
@@ -118,13 +125,18 @@ class EntraAppSetCommand extends GraphCommand {
118
125
this . optionSets . push ( { options : [ 'appId' , 'objectId' , 'name' ] } ) ;
119
126
}
120
127
128
+ #initTypes( ) : void {
129
+ this . types . boolean . push ( 'allowPublicClientFlows' ) ;
130
+ }
131
+
121
132
public async commandAction ( logger : Logger , args : CommandArgs ) : Promise < void > {
122
133
await this . showDeprecationWarning ( logger , aadCommands . APP_SET , commands . APP_SET ) ;
123
134
124
135
try {
125
136
let objectId = await this . getAppObjectId ( args , logger ) ;
126
137
objectId = await this . configureUri ( args , objectId , logger ) ;
127
138
objectId = await this . configureRedirectUris ( args , objectId , logger ) ;
139
+ objectId = await this . updateAllowPublicClientFlows ( args , objectId , logger ) ;
128
140
await this . configureCertificate ( args , objectId , logger ) ;
129
141
}
130
142
catch ( err : any ) {
@@ -171,6 +183,32 @@ class EntraAppSetCommand extends GraphCommand {
171
183
return result . id ;
172
184
}
173
185
186
+ private async updateAllowPublicClientFlows ( args : CommandArgs , objectId : string , logger : Logger ) : Promise < string > {
187
+ if ( args . options . allowPublicClientFlows === undefined ) {
188
+ return objectId ;
189
+ }
190
+
191
+ if ( this . verbose ) {
192
+ await logger . logToStderr ( `Configuring Entra application AllowPublicClientFlows option...` ) ;
193
+ }
194
+
195
+ const applicationInfo : any = {
196
+ isFallbackPublicClient : args . options . allowPublicClientFlows
197
+ } ;
198
+
199
+ const requestOptions : CliRequestOptions = {
200
+ url : `${ this . resource } /v1.0/myorganization/applications/${ objectId } ` ,
201
+ headers : {
202
+ 'content-type' : 'application/json;odata.metadata=none'
203
+ } ,
204
+ responseType : 'json' ,
205
+ data : applicationInfo
206
+ } ;
207
+
208
+ await request . patch ( requestOptions ) ;
209
+ return objectId ;
210
+ }
211
+
174
212
private async configureUri ( args : CommandArgs , objectId : string , logger : Logger ) : Promise < string > {
175
213
if ( ! args . options . uris ) {
176
214
return objectId ;
0 commit comments