diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_certificate_on_the_environment_variables.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_certificate_on_the_environment_variables.js deleted file mode 100644 index 54122f1c04f2..000000000000 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_certificate_on_the_environment_variables.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "770be7fa040679271c5ecc398a872004"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_secret_on_the_environment_variables.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_secret_on_the_environment_variables.js index 0fdec0cd3de0..4a7df189d2dd 100644 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_secret_on_the_environment_variables.js +++ b/sdk/identity/identity/recordings/node/applicationcredential/recording_authenticates_with_a_client_secret_on_the_environment_variables.js @@ -23,11 +23,11 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '03ae322b-b044-4a1c-bb4b-356792c20f01', + '54656735-48e1-4eb1-bfc3-42b302a05b00', 'x-ms-ests-server', - '2.1.11898.12 - NCUS ProdSlices', + '2.1.11935.12 - WUS2 ProdSlices', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:12 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', @@ -35,7 +35,7 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:43 GMT', + 'Thu, 05 Aug 2021 23:14:12 GMT', 'Content-Length', '980' ]); @@ -58,11 +58,11 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '9992900b-6b15-4fba-a29c-ff2c78781000', + '30d8ef8c-f820-4adc-96c8-853b32ff3800', 'x-ms-ests-server', '2.1.11935.12 - WUS2 ProdSlices', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:12 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', @@ -70,7 +70,7 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:43 GMT', + 'Thu, 05 Aug 2021 23:14:12 GMT', 'Content-Length', '1753' ]); @@ -93,19 +93,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '87031f9e-911b-4412-8e41-038050cc0600', + '5d25849e-e99b-4f2e-b3ec-7f4efa843b00', 'x-ms-ests-server', - '2.1.11935.12 - NCUS ProdSlices', + '2.1.11935.12 - SCUS ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:13 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:43 GMT', + 'Thu, 05 Aug 2021 23:14:12 GMT', 'Content-Length', '1315' ]); diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_finds_and_uses_client_usernamepassword_environment_variables.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_finds_and_uses_client_usernamepassword_environment_variables.js deleted file mode 100644 index a07e5d9176ad..000000000000 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_finds_and_uses_client_usernamepassword_environment_variables.js +++ /dev/null @@ -1,111 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "90ea55c253ab9555e53638d3d3b43858"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '1fe2a56f-3cba-4d09-b578-5e6f8b394300', - 'x-ms-ests-server', - '2.1.11898.12 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 08:21:45 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 04 Aug 2021 08:21:45 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"azure_azure_usernamenameinfo_endpoint":"https://graph.microsoft.com/oidc/azure_azure_usernamenameinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_azure_azure_usernamenamename","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '22e757b3-2899-4102-9d93-2bc0947d0f01', - 'x-ms-ests-server', - '2.1.11898.12 - NCUS ProdSlices', - 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 08:21:45 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 04 Aug 2021 08:21:45 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&azure_azure_usernamenamename=azure_azure_usernamename&azure_azure_password=azure_azure_password&scope=scope%20openid%20profile%20offline_access&grant_type=azure_azure_password&client_info=1&x-client-SKU=msal.js.node&x-client-VER=1.2.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=2|371,0|,&x-client-last-telemetry=2|0|||0,0&client-request-id=client-request-id") - .reply(400, {"error":"invalid_grant","error_description":"AADSTS50034: The azure_azure_usernamename account azure_azure_usernamename does not exist in the 12345678-1234-1234-1234-123456789012 directory. To sign into this application, the account must be added to the directory.\r\nTrace ID: 31eaf6eb-f2d8-4324-8d9f-0ddf70734101\r\nCorrelation ID: 2bd41f9f-0ec3-44e8-8ad0-f34262084004\r\nTimestamp: 2021-08-04 08:21:45Z","error_codes":[50034],"timestamp":"2021-08-04 08:21:45Z","trace_id":"31eaf6eb-f2d8-4324-8d9f-0ddf70734101","correlation_id":"2bd41f9f-0ec3-44e8-8ad0-f34262084004","error_uri":"https://login.microsoftonline.com/error?code=50034","suberror":"bad_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '31eaf6eb-f2d8-4324-8d9f-0ddf70734101', - 'x-ms-ests-server', - '2.1.11898.12 - EUS ProdSlices', - 'x-ms-clitelem', - '1,50034,0,,', - 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 08:21:45 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 04 Aug 2021 08:21:45 GMT', - 'Content-Length', - '619' -]); diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_certificate.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_certificate.js deleted file mode 100644 index 5d3e9279fa79..000000000000 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_certificate.js +++ /dev/null @@ -1,5 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "e854a1fc8b3484a8679124a3c20d5303"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_secret.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_secret.js index d73ed1f38a56..f734a36f1443 100644 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_secret.js +++ b/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_client_secret.js @@ -23,11 +23,11 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'd1b3b326-7705-40a6-bb97-a73aff866902', + '8e585fff-4996-4728-83e0-518e7345de01', 'x-ms-ests-server', - '2.1.11898.12 - EUS ProdSlices', + '2.1.11898.12 - NCUS ProdSlices', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:13 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', @@ -35,7 +35,7 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:43 GMT', + 'Thu, 05 Aug 2021 23:14:12 GMT', 'Content-Length', '980' ]); @@ -58,11 +58,11 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '53bd86e2-56a4-43eb-bc48-a3243a4c0500', + '1bd469dd-c998-4c70-88ad-188983123a00', 'x-ms-ests-server', - '2.1.11935.12 - NCUS ProdSlices', + '2.1.11935.12 - EUS ProdSlices', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:13 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', @@ -70,7 +70,7 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:43 GMT', + 'Thu, 05 Aug 2021 23:14:12 GMT', 'Content-Length', '1753' ]); @@ -93,19 +93,19 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - '6a6b1f25-7dc6-4684-bf38-252217330f00', + '20a1a05c-5822-474d-b862-ec1d8c8b3c00', 'x-ms-ests-server', - '2.1.11935.12 - WUS2 ProdSlices', + '2.1.11935.12 - EUS ProdSlices', 'x-ms-clitelem', '1,0,0,,', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:44 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:13 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:44 GMT', + 'Thu, 05 Aug 2021 23:14:12 GMT', 'Content-Length', '1315' ]); diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_usernamepassword.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_usernamepassword.js deleted file mode 100644 index 05a63880aae8..000000000000 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_supports_tracing_with_environment_usernamepassword.js +++ /dev/null @@ -1,111 +0,0 @@ -let nock = require('nock'); - -module.exports.hash = "b5a4d41bd6e386f72f5a1e905188a949"; - -module.exports.testInfo = {"uniqueName":{},"newDate":{}} - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/common/discovery/instance') - .query(true) - .reply(200, {"tenant_discovery_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration","api-version":"1.1","metadata":[{"preferred_network":"login.microsoftonline.com","preferred_cache":"login.windows.net","aliases":["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{"preferred_network":"login.partner.microsoftonline.cn","preferred_cache":"login.partner.microsoftonline.cn","aliases":["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{"preferred_network":"login.microsoftonline.de","preferred_cache":"login.microsoftonline.de","aliases":["login.microsoftonline.de"]},{"preferred_network":"login.microsoftonline.us","preferred_cache":"login.microsoftonline.us","aliases":["login.microsoftonline.us","login.usgovcloudapi.net"]},{"preferred_network":"login-us.microsoftonline.com","preferred_cache":"login-us.microsoftonline.com","aliases":["login-us.microsoftonline.com"]}]}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - 'fe9f4fb9-40e4-4fde-ae5c-36e7e6a42402', - 'x-ms-ests-server', - '2.1.11898.12 - SCUS ProdSlices', - 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 08:25:42 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 04 Aug 2021 08:25:41 GMT', - 'Content-Length', - '980' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') - .reply(200, {"token_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token","token_endpoint_auth_methods_supported":["client_secret_post","private_key_jwt","client_secret_basic"],"jwks_uri":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/discovery/v2.0/keys","response_modes_supported":["query","fragment","form_post"],"subject_types_supported":["pairwise"],"id_token_signing_alg_values_supported":["RS256"],"response_types_supported":["code","id_token","code id_token","id_token token"],"scopes_supported":["openid","profile","email","offline_access"],"issuer":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/v2.0","request_uri_parameter_supported":false,"azure_azure_usernamenameinfo_endpoint":"https://graph.microsoft.com/oidc/azure_azure_usernamenameinfo","authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/authorize","device_authorization_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/devicecode","http_logout_supported":true,"frontchannel_logout_supported":true,"end_session_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/oauth2/v2.0/logout","claims_supported":["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_azure_azure_usernamenamename","name","tid","ver","at_hash","c_hash","email"],"kerberos_endpoint":"https://login.microsoftonline.com/12345678-1234-1234-1234-123456789012/kerberos","tenant_region_scope":"WW","cloud_instance_name":"microsoftonline.com","cloud_graph_host_name":"graph.windows.net","msgraph_host":"graph.microsoft.com","rbac_url":"https://pas.windows.net"}, [ - 'Cache-Control', - 'max-age=86400, private', - 'Content-Type', - 'application/json; charset=utf-8', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'Access-Control-Allow-Origin', - '*', - 'Access-Control-Allow-Methods', - 'GET, OPTIONS', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '1db1aa08-cee3-4680-a515-efcc6de55201', - 'x-ms-ests-server', - '2.1.11898.12 - EUS ProdSlices', - 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 08:25:42 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 04 Aug 2021 08:25:42 GMT', - 'Content-Length', - '1753' -]); - -nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) - .post('/12345678-1234-1234-1234-123456789012/oauth2/v2.0/token', "client_id=azure_client_id&azure_azure_usernamenamename=azure_azure_usernamename&azure_azure_password=azure_azure_password&scope=https%3A%2F%2Fsanitized%2F&grant_type=azure_azure_password&client_info=1&x-client-SKU=msal.js.node&x-client-VER=1.2.0&x-client-OS=win32&x-client-CPU=x64&x-ms-lib-capability=retry-after, h429&x-client-current-telemetry=2|371,0|,&x-client-last-telemetry=2|0|||0,0&client-request-id=client-request-id") - .reply(400, {"error":"invalid_grant","error_description":"AADSTS50034: The azure_azure_usernamename account azure_azure_usernamename does not exist in the 12345678-1234-1234-1234-123456789012 directory. To sign into this application, the account must be added to the directory.\r\nTrace ID: 1918afda-8c47-49a2-9b8c-c3d2cb694f01\r\nCorrelation ID: ca21231a-8476-4221-811b-96cb03410a76\r\nTimestamp: 2021-08-04 08:25:43Z","error_codes":[50034],"timestamp":"2021-08-04 08:25:43Z","trace_id":"1918afda-8c47-49a2-9b8c-c3d2cb694f01","correlation_id":"ca21231a-8476-4221-811b-96cb03410a76","error_uri":"https://login.microsoftonline.com/error?code=50034","suberror":"bad_token"}, [ - 'Cache-Control', - 'no-store, no-cache', - 'Pragma', - 'no-cache', - 'Content-Type', - 'application/json; charset=utf-8', - 'Expires', - '-1', - 'Strict-Transport-Security', - 'max-age=31536000; includeSubDomains', - 'X-Content-Type-Options', - 'nosniff', - 'P3P', - 'CP="DSP CUR OTPi IND OTRi ONL FIN"', - 'x-ms-request-id', - '1918afda-8c47-49a2-9b8c-c3d2cb694f01', - 'x-ms-ests-server', - '2.1.11898.12 - EUS ProdSlices', - 'x-ms-clitelem', - '1,50034,0,,', - 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 08:25:43 GMT; path=/; secure; HttpOnly; SameSite=None', - 'Set-Cookie', - 'x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly', - 'Set-Cookie', - 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', - 'Date', - 'Wed, 04 Aug 2021 08:25:42 GMT', - 'Content-Length', - '619' -]); diff --git a/sdk/identity/identity/recordings/node/applicationcredential/recording_throws_an_authenticationerror_when_gettoken_is_called_and_applicationcredential_authentication_failed.js b/sdk/identity/identity/recordings/node/applicationcredential/recording_throws_an_authenticationerror_when_gettoken_is_called_and_applicationcredential_authentication_failed.js index de59badd5ba6..dd0ab0f7ca5b 100644 --- a/sdk/identity/identity/recordings/node/applicationcredential/recording_throws_an_authenticationerror_when_gettoken_is_called_and_applicationcredential_authentication_failed.js +++ b/sdk/identity/identity/recordings/node/applicationcredential/recording_throws_an_authenticationerror_when_gettoken_is_called_and_applicationcredential_authentication_failed.js @@ -23,11 +23,11 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'fd9ef937-a8ef-463e-9458-a42191d67a02', + '87378bfa-4cc9-4279-998f-d187ff277201', 'x-ms-ests-server', - '2.1.11898.12 - SCUS ProdSlices', + '2.1.11898.12 - EUS ProdSlices', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:51 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:13 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', @@ -35,14 +35,14 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:50 GMT', + 'Thu, 05 Aug 2021 23:14:13 GMT', 'Content-Length', '950' ]); nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) .get('/12345678-1234-1234-1234-123456789012/v2.0/.well-known/openid-configuration') - .reply(400, {"error":"invalid_12345678-1234-1234-1234-123456789012","error_description":"AADSTS90002: Tenant '12345678-1234-1234-1234-123456789012' not found. This may happen if there are no active subscriptions for the 12345678-1234-1234-1234-123456789012. Check to make sure you have the correct 12345678-1234-1234-1234-123456789012 ID. Check with your subscription administrator.\r\nTrace ID: a598318a-476a-4c23-bccf-7d8bd8059002\r\nCorrelation ID: ae736832-b4ed-4875-a224-66e74deddd49\r\nTimestamp: 2021-08-04 23:51:51Z","error_codes":[90002],"timestamp":"2021-08-04 23:51:51Z","trace_id":"a598318a-476a-4c23-bccf-7d8bd8059002","correlation_id":"ae736832-b4ed-4875-a224-66e74deddd49","error_uri":"https://login.microsoftonline.com/error?code=90002"}, [ + .reply(400, {"error":"invalid_12345678-1234-1234-1234-123456789012","error_description":"AADSTS90002: Tenant '12345678-1234-1234-1234-123456789012' not found. This may happen if there are no active subscriptions for the 12345678-1234-1234-1234-123456789012. Check to make sure you have the correct 12345678-1234-1234-1234-123456789012 ID. Check with your subscription administrator.\r\nTrace ID: c95ed377-3195-434d-8cac-0f5460a11f02\r\nCorrelation ID: 5bf6f73d-9031-4e3f-b44e-7b7d1ebe9864\r\nTimestamp: 2021-08-05 23:14:13Z","error_codes":[90002],"timestamp":"2021-08-05 23:14:13Z","trace_id":"c95ed377-3195-434d-8cac-0f5460a11f02","correlation_id":"5bf6f73d-9031-4e3f-b44e-7b7d1ebe9864","error_uri":"https://login.microsoftonline.com/error?code=90002"}, [ 'Cache-Control', 'max-age=86400, private', 'Content-Type', @@ -58,11 +58,11 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'P3P', 'CP="DSP CUR OTPi IND OTRi ONL FIN"', 'x-ms-request-id', - 'a598318a-476a-4c23-bccf-7d8bd8059002', + 'c95ed377-3195-434d-8cac-0f5460a11f02', 'x-ms-ests-server', - '2.1.11898.12 - SCUS ProdSlices', + '2.1.11898.12 - NCUS ProdSlices', 'Set-Cookie', - 'fpc=fpc;; expires=Fri, 03-Sep-2021 23:51:51 GMT; path=/; secure; HttpOnly; SameSite=None', + 'fpc=fpc;; expires=Sat, 04-Sep-2021 23:14:13 GMT; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', 'esctx=esctx; domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None', 'Set-Cookie', @@ -70,7 +70,7 @@ nock('https://login.microsoftonline.com:443', {"encodedQueryParams":true}) 'Set-Cookie', 'stsservicecookie=estsfd; path=/; secure; samesite=none; httponly', 'Date', - 'Wed, 04 Aug 2021 23:51:50 GMT', + 'Thu, 05 Aug 2021 23:14:13 GMT', 'Content-Length', '621' ]); diff --git a/sdk/identity/identity/test/internal/node/applicationCredential.spec.ts b/sdk/identity/identity/test/internal/node/applicationCredential.spec.ts index 029f1dcf73eb..e9cfd4972e58 100644 --- a/sdk/identity/identity/test/internal/node/applicationCredential.spec.ts +++ b/sdk/identity/identity/test/internal/node/applicationCredential.spec.ts @@ -11,12 +11,7 @@ import { SendCredentialRequests } from "../../httpRequestsCommon"; -// interface AuthRequestDetails { -// requests: WebResource[]; -// token: AccessToken | null; -// } - -describe("ApplicationCredential (internal)", function() { +describe("ApplicationCredential testing Managed Identity (internal)", function() { let envCopy: string = ""; let testContext: IdentityTestContext; let sendCredentialRequests: SendCredentialRequests; @@ -25,6 +20,8 @@ describe("ApplicationCredential (internal)", function() { envCopy = JSON.stringify(process.env); delete process.env.MSI_ENDPOINT; delete process.env.MSI_SECRET; + delete process.env.AZURE_CLIENT_SECRET; + delete process.env.AZURE_TENANT_ID; testContext = await prepareIdentityTests({}); sendCredentialRequests = testContext.sendCredentialRequests; }); @@ -32,6 +29,8 @@ describe("ApplicationCredential (internal)", function() { const env = JSON.parse(envCopy); process.env.MSI_ENDPOINT = env.MSI_ENDPOINT; process.env.MSI_SECRET = env.MSI_SECRET; + process.env.AZURE_CLIENT_SECRET = env.AZURE_CLIENT_SECRET; + process.env.AZURE_TENANT_ID = env.AZURE_TENANT_ID; await testContext.restore(); }); @@ -90,6 +89,7 @@ describe("ApplicationCredential (internal)", function() { it("sends an authorization request correctly in an App Service environment", async () => { // Trigger App Service behavior by setting environment variables + process.env.AZURE_CLIENT_ID = "client"; process.env.MSI_ENDPOINT = "https://endpoint"; process.env.MSI_SECRET = "secret"; diff --git a/sdk/identity/identity/test/public/node/applicationCredential.spec.ts b/sdk/identity/identity/test/public/node/applicationCredential.spec.ts index d7ecc66e6078..4229b28f866d 100644 --- a/sdk/identity/identity/test/public/node/applicationCredential.spec.ts +++ b/sdk/identity/identity/test/public/node/applicationCredential.spec.ts @@ -4,7 +4,7 @@ /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */ import assert from "assert"; -import { CredentialUnavailableError, ApplicationCredential } from "../../../src"; +import { ApplicationCredential } from "../../../src"; import { MsalTestCleanup, msalNodeTestSetup, testTracing } from "../../msalTestUtils"; import { getError } from "../../authTestUtils"; import { Context } from "mocha"; @@ -82,12 +82,12 @@ describe("ApplicationCredential", function() { it("throws an CredentialUnavailable when getToken is called and no credential was configured", async () => { const credential = new ApplicationCredential(); - await assertRejects( - credential.getToken(scope), - (error: CredentialUnavailableError) => - error.message.indexOf( - `CredentialUnavailableError: EnvironmentCredential is unavailable. No underlying credential could be used.\nCredentialUnavailableError: ManagedIdentityCredential is unavailable. Network unreachable.` - ) > -1 + const error = await getError(credential.getToken(scope)); + assert.equal(error.name, "CredentialUnavailableError"); + assert.ok( + error.message.indexOf( + `CredentialUnavailableError: EnvironmentCredential is unavailable. No underlying credential could be used.\nCredentialUnavailableError: ManagedIdentityCredential is unavailable. Network unreachable.` + ) > -1 ); }); diff --git a/sdk/identity/identity/test/public/node/environmentCredential.spec.ts b/sdk/identity/identity/test/public/node/environmentCredential.spec.ts index 3450bd9dddbd..08a775dac020 100644 --- a/sdk/identity/identity/test/public/node/environmentCredential.spec.ts +++ b/sdk/identity/identity/test/public/node/environmentCredential.spec.ts @@ -4,7 +4,7 @@ /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */ import sinon from "sinon"; -import { assert } from "chai"; +import assert from "assert"; import { isPlaybackMode } from "@azure/test-utils-recorder"; import { EnvironmentCredential, UsernamePasswordCredential } from "../../../src"; import { MsalTestCleanup, msalNodeTestSetup, testTracing } from "../../msalTestUtils";