File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed
articles/active-directory/develop Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -206,19 +206,21 @@ class ClientAssertionCredential implements TokenCredential {
206
206
207
207
// Get the ID token from Google.
208
208
return getGoogleIDToken () // calling this directly just for clarity,
209
- // this should be a callback
210
- // pass this as a client assertion to the confidential client app
211
- .then ((clientAssertion : any )=> {
212
- var msalApp: any ;
213
- msalApp = new msal .ConfidentialClientApplication ({
214
- auth: {
215
- clientId: this .clientID ,
216
- authority: this .aadAuthority + this .tenantID ,
217
- clientAssertion: clientAssertion ,
218
- }
219
- });
220
- return msalApp .acquireTokenByClientCredential ({ scopes })
221
- })
209
+
210
+ let aadAudience = " api://AzureADTokenExchange"
211
+ const jwt = axios ({
212
+
213
+ url: " http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/identity?audience="
214
+ + aadAudience ,
215
+ method: " GET" ,
216
+ headers: {
217
+ " Metadata-Flavor" : " Google"
218
+ }}).then (response => {
219
+ console .log (" AXIOS RESPONSE" );
220
+ return response .data ;
221
+ });
222
+ return jwt ;
223
+
222
224
.then (function (aadToken ) {
223
225
// return in form expected by TokenCredential.getToken
224
226
let returnToken = {
You can’t perform that action at this time.
0 commit comments