diff --git a/sdk/identity/azure-identity/conftest.py b/sdk/identity/azure-identity/conftest.py index 1935b27ed3e9..f52c1f62bc4f 100644 --- a/sdk/identity/azure-identity/conftest.py +++ b/sdk/identity/azure-identity/conftest.py @@ -5,8 +5,10 @@ import os import sys +from unittest import mock import pytest import six +from devtools_testutils import test_proxy, add_general_regex_sanitizer, is_live, add_body_key_sanitizer from azure.identity._constants import DEVELOPER_SIGN_ON_CLIENT_ID, EnvironmentVariables RECORD_IMDS = "--record-imds" @@ -45,7 +47,7 @@ def record_imds_test(request): Recorded IMDS tests run as expected in playback. However, because they require particular live environments, a custom pytest option ("--record-imds") controls whether they're included in a live test run. """ - if request.instance.is_live and not request.session.config.getoption(RECORD_IMDS): + if is_live() and not request.session.config.getoption(RECORD_IMDS): pytest.skip('Run "pytest {}" to record a live run of this test'.format(RECORD_IMDS)) @@ -159,3 +161,54 @@ def event_loop(): yield loop loop.close() + +@pytest.fixture(scope="session", autouse=True) +def add_sanitizers(test_proxy): + if EnvironmentVariables.MSI_ENDPOINT in os.environ: + url = os.environ.get(EnvironmentVariables.MSI_ENDPOINT) + PLAYBACK_URL = "https://msi-endpoint/token" + add_general_regex_sanitizer(regex=url, value=PLAYBACK_URL) + if "USER_ASSIGNED_IDENTITY_CLIENT_ID" in os.environ: + PLAYBACK_CLIENT_ID = "client-id" + user_assigned_identity_client_id = os.environ.get("USER_ASSIGNED_IDENTITY_CLIENT_ID") + add_general_regex_sanitizer(regex=user_assigned_identity_client_id, value=PLAYBACK_CLIENT_ID) + if "CAE_ARM_URL" in os.environ and "CAE_TENANT_ID" in os.environ and "CAE_USERNAME" in os.environ: + try: + from six.moves.urllib_parse import urlparse + arm_url = os.environ["CAE_ARM_URL"] + real = urlparse(arm_url) + add_general_regex_sanitizer(regex=real.netloc, value="management.azure.com") + add_general_regex_sanitizer(regex=os.environ["CAE_TENANT_ID"], value="tenant") + add_general_regex_sanitizer(regex=os.environ["CAE_USERNAME"], value="username") + except Exception: + pass + if "OBO_TENANT_ID" in os.environ and "OBO_USERNAME" in os.environ: + add_general_regex_sanitizer(regex=os.environ["OBO_TENANT_ID"], value="tenant") + add_general_regex_sanitizer(regex=os.environ["OBO_USERNAME"], value="username") + add_body_key_sanitizer(json_path="$..access_token", value="access_token") + + +@pytest.fixture(scope="session", autouse=True) +def patch_async_sleep(): + async def immediate_return(_): + return + + if not is_live(): + with mock.patch("asyncio.sleep", immediate_return): + yield + + else: + yield + + +@pytest.fixture(scope="session", autouse=True) +def patch_sleep(): + def immediate_return(_): + return + + if not is_live(): + with mock.patch("time.sleep", immediate_return): + yield + + else: + yield diff --git a/sdk/identity/azure-identity/tests/recorded_test_case.py b/sdk/identity/azure-identity/tests/recorded_test_case.py index e56316a2fac4..3e35a3a171ad 100644 --- a/sdk/identity/azure-identity/tests/recorded_test_case.py +++ b/sdk/identity/azure-identity/tests/recorded_test_case.py @@ -4,35 +4,20 @@ # ------------------------------------ import os -from azure_devtools.scenario_tests import GeneralNameReplacer, patch_time_sleep_api, RequestUrlNormalizer -from devtools_testutils.azure_testcase import AzureTestCase +from devtools_testutils import AzureRecordedTestCase, is_live import pytest -from recording_processors import IdTokenProcessor, RecordingRedactor - PLAYBACK_CLIENT_ID = "client-id" -class RecordedTestCase(AzureTestCase): - def __init__(self, *args, **kwargs): - scrubber = GeneralNameReplacer() - super(RecordedTestCase, self).__init__( - *args, - recording_processors=[RecordingRedactor(), scrubber], - replay_processors=[IdTokenProcessor(), RequestUrlNormalizer()], - **kwargs - ) - self.scrubber = scrubber - self.replay_patches.append(patch_time_sleep_api) - self.user_assigned_identity_client_id = os.environ.get("USER_ASSIGNED_IDENTITY_CLIENT_ID", PLAYBACK_CLIENT_ID) +class RecordedTestCase(AzureRecordedTestCase): @pytest.fixture() def user_assigned_identity_client_id(self): - if self.is_live: + self.user_assigned_identity_client_id = os.environ.get("USER_ASSIGNED_IDENTITY_CLIENT_ID", PLAYBACK_CLIENT_ID) + if is_live(): if self.user_assigned_identity_client_id == PLAYBACK_CLIENT_ID: pytest.skip("Set a value for $USER_ASSIGNED_IDENTITY_CLIENT_ID to record this test") - else: - self.scrubber.register_name_pair(self.user_assigned_identity_client_id, PLAYBACK_CLIENT_ID) @property def scope(self): diff --git a/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml b/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml deleted file mode 100644 index a4fe94f5d38a..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_cae.test_device_code.yaml +++ /dev/null @@ -1,865 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1651' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:48:47 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwIQ; expires=Fri, 19-Feb-2021 17:48:48 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=prod; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.11397.13 - SAN ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '128' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwIQ; stsservicecookie=ests; x-ms-gateway-slice=prod - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode - response: - body: - string: '{"user_code": "redacted3c59ab", - "device_code": "redactedb9ef25", - "verification_uri": "https://microsoft.com/devicelogin", "expires_in": 900, - "interval": 5, "message": "redactedf09f37"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '473' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:48:47 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAA; expires=Fri, 19-Feb-2021 - 17:48:48 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.11397.13 - EUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '654' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAA; stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|622,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"error": "authorization_pending", "error_description": "AADSTS70016: - OAuth 2.0 device flow error. Authorization is pending. Continue polling.\r\nTrace - ID: e9b0989d-88df-4b2b-9059-6ebaf060b401\r\nCorrelation ID: 68ba2961-0b13-4411-8f91-adf1a39530b9\r\nTimestamp: - 2021-01-20 17:49:04Z", "error_codes": [70016], "timestamp": "2021-01-20 17:49:04Z", - "trace_id": "e9b0989d-88df-4b2b-9059-6ebaf060b401", "correlation_id": "68ba2961-0b13-4411-8f91-adf1a39530b9", - "error_uri": "https://login.microsoftonline.com/error?code=70016"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '510' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:49:03 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAA; expires=Fri, 19-Feb-2021 - 17:49:04 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,70016,0,, - x-ms-ests-server: - - 2.1.11397.13 - SCUS ProdSlices - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '654' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAA; stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|622,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"error": "authorization_pending", "error_description": "AADSTS70016: - OAuth 2.0 device flow error. Authorization is pending. Continue polling.\r\nTrace - ID: f0f691d8-d0d5-4c90-80ef-b928d1edb401\r\nCorrelation ID: 68ba2961-0b13-4411-8f91-adf1a39530b9\r\nTimestamp: - 2021-01-20 17:49:09Z", "error_codes": [70016], "timestamp": "2021-01-20 17:49:09Z", - "trace_id": "f0f691d8-d0d5-4c90-80ef-b928d1edb401", "correlation_id": "68ba2961-0b13-4411-8f91-adf1a39530b9", - "error_uri": "https://login.microsoftonline.com/error?code=70016"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '510' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:49:08 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAA; expires=Fri, 19-Feb-2021 - 17:49:09 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,70016,0,, - x-ms-ests-server: - - 2.1.11397.13 - SCUS ProdSlices - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '654' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAA; stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|622,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation - https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "redactedca8839", - "refresh_token": "redacted7ef8cf", - "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjQ2NTQsIm5iZiI6MTYxMTE2NDY1NCwiZXhwIjoxNjExMTY4NTU0LCJhaW8iOiJBVFFBeS84U0FBQUE4Zjl5WTlKeUFBRFQ5bEZkdlVKYU4ybk1NT3ROeGkwVlk1MWRUQUE0eFlWU3psdndwQ3NDNmdIcFRFSzB1MG1kIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6Ii10aTBqY1VrTjA2eHlxcTAzY0tFQVEiLCJ2ZXIiOiIyLjAifQ.cnsvmmnQzua0aZ96pXJOGq8hdgyUhy2DMTN2Yzjvs5TZCRd0voB0Ox_4VmjID3CFiixFOD58tn69pu5DkWEk8T3cBXMBecBRefdjEJcVuDeAQ_GnKZgVGVMjYHERcDxanukaknzs69an8nFASBJVHcLvaiRvy5UtJ4tJPpL1yM1XXwJd6EV4e2mqDt_5SgyWM_O2QPNtQF3IuozWRGrJ84ap2VN-zgkLrZRHeiE9XtNByQDfcwEXcxznx64lOXdJmUyfpxu8iiwChUzCa01PA-gM7UjTIBe_e71ALWdIj3fLmKp3HlquSDDV-eb9jTQrhtn7MtzONk6WbQTOahVMRA", - "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '4361' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:49:14 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAAeUvQaQEAAAAaZJrXDgAAAA; expires=Fri, - 19-Feb-2021 17:49:15 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.11397.13 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-resource/0.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions?api-version=2019-11-01 - response: - body: - string: '{"value": [], "count": {"type": "Total", "value": 0}}' - headers: - cache-control: - - no-cache - content-length: - - '47' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:49:17 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-resource/0.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions?api-version=2019-11-01 - response: - body: - string: '{"error": {"code": "AuthenticationFailed", "message": "Authentication - failed."}}' - headers: - cache-control: - - no-cache - connection: - - close - content-length: - - '76' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:55:59 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer authorization_uri="https://login.windows.net/", error="invalid_token", - error_description="User session has been revoked", claims="eyJhY2Nlc3NfdG9rZW4iOnsibmJmIjp7ImVzc2VudGlhbCI6dHJ1ZSwgInZhbHVlIjoiMTYxMTE2NTM1OSJ9fX0=" - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '1508' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwIQguT8RAQAAAP9jmtcOAAAAeUvQaQEAAAAaZJrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|84,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"error": "invalid_grant", "error_description": "AADSTS50173: The provided - grant has expired due to it being revoked, a fresh auth token is needed. The - user might have changed or reset their password. The grant was issued on ''2021-01-20T17:49:09.5646304Z'' - and the TokensValidFrom date (before which tokens are not valid) for this - user is ''2021-01-20T17:49:18.0000000Z''.\r\nTrace ID: fb266710-409a-4c3e-a217-551bf350d700\r\nCorrelation - ID: 2a23310f-0df8-4f45-a7f9-80345ed363f0\r\nTimestamp: 2021-01-20 17:56:00Z", - "error_codes": [50173], "timestamp": "2021-01-20 17:56:00Z", "trace_id": "fb266710-409a-4c3e-a217-551bf350d700", - "correlation_id": "2a23310f-0df8-4f45-a7f9-80345ed363f0", "error_uri": "https://login.microsoftonline.com/error?code=50173", - "suberror": "bad_token"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '760' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:00 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAeUvQaQEAAAAaZJrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - expires=Fri, 19-Feb-2021 17:56:00 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,50173,0,402450.2092, - x-ms-ests-server: - - 2.1.11397.13 - WUS2 ProdSlices - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAeUvQaQEAAAAaZJrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize - response: - body: - string: '{"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.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"]}]}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '945' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:00 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAeUvQaQEAAAAaZJrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - expires=Fri, 19-Feb-2021 17:56:00 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.11397.13 - EUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '128' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAeUvQaQEAAAAaZJrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode - response: - body: - string: '{"user_code": "redacted221497", - "device_code": "redacted486127", - "verification_uri": "https://microsoft.com/devicelogin", "expires_in": 900, - "interval": 5, "message": "redactedb92935"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '473' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:00 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - expires=Fri, 19-Feb-2021 17:56:00 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.11397.13 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '735' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|622,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"error": "authorization_pending", "error_description": "AADSTS70016: - OAuth 2.0 device flow error. Authorization is pending. Continue polling.\r\nTrace - ID: c0b1f362-14e3-4811-93ca-434e3c99d400\r\nCorrelation ID: 6ba32921-617b-40ec-b511-241b3c98a7d5\r\nTimestamp: - 2021-01-20 17:56:16Z", "error_codes": [70016], "timestamp": "2021-01-20 17:56:16Z", - "trace_id": "c0b1f362-14e3-4811-93ca-434e3c99d400", "correlation_id": "6ba32921-617b-40ec-b511-241b3c98a7d5", - "error_uri": "https://login.microsoftonline.com/error?code=70016"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '510' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:16 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - expires=Fri, 19-Feb-2021 17:56:16 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,70016,0,, - x-ms-ests-server: - - 2.1.11397.13 - EUS ProdSlices - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '735' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|622,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"error": "authorization_pending", "error_description": "AADSTS70016: - OAuth 2.0 device flow error. Authorization is pending. Continue polling.\r\nTrace - ID: 281a0b66-df4c-448e-ba01-89cf75f7c101\r\nCorrelation ID: 6ba32921-617b-40ec-b511-241b3c98a7d5\r\nTimestamp: - 2021-01-20 17:56:22Z", "error_codes": [70016], "timestamp": "2021-01-20 17:56:22Z", - "trace_id": "281a0b66-df4c-448e-ba01-89cf75f7c101", "correlation_id": "6ba32921-617b-40ec-b511-241b3c98a7d5", - "error_uri": "https://login.microsoftonline.com/error?code=70016"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '510' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:21 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - expires=Fri, 19-Feb-2021 17:56:22 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,70016,0,, - x-ms-ests-server: - - 2.1.11397.13 - EUS ProdSlices - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '735' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL4pTcs2nJCalp3mS66FDSyP9ddacNcUjMn-NBJHtqPUbDaud7LQftlxdSSmF9tpZRKmtm_ajTzGa-JaJWMwMRoRWgTZpvPCSzL4DTgR3htWfaPWgkKM7BppxI58iZ-z1YHg2xu8-9ChyvvA0R9BBcUY4xVxdNaK0Ru0IZXj51YTcQgAA; - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAN-d3AMBAAAAHWSa1w4AAAA; - stsservicecookie=ests; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|622,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation - https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "redacteda22f90", - "refresh_token": "redacted0f5082", - "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjUwODcsIm5iZiI6MTYxMTE2NTA4NywiZXhwIjoxNjExMTY4OTg3LCJhaW8iOiJBVFFBeS84U0FBQUE4L1lxaDZrd3UrRnJ3TjV2bENVQ2Z5QVlmVDR1dExpTitpeFhZS0ZsWEhZZndiSDZITW9JZEpMazlJMVZnMy9XIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6Ik9WY3ZkbXVncEV1YllWQU9va0szQVEiLCJ2ZXIiOiIyLjAifQ.b17pJRXmw9YnC97aQbdKihqjTnqYuFSGH0AxdtDk4cpt9ZviJV19dz5wVxaUORGNf6K6vnFhZRlEX89bhMLH1BpVq5lc28IQ-8zk-Q6ItIap2xVS4u2jjHHoSZLoIPtNXMXPnOz_KPuff_L46mJpKoBxpEOBUvB6Tx_k-hLyrabpNYo_swBemamDylbrDPUpyNZCIlHi_qMH60Hrtfg9JlnGUeUUi-seY4vRQcTnAB-wvsQtMWbKYsEpBgjUihoqScRZMNC9j3HuvAsWurrCIJ4vZ6WKsjg7aoqC-Z-AWnOmvVSlUTajCI1HFzhjcTYDRS_WrcKnModSLvR1I6eMrw", - "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '4361' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:27 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApqwGRndfkRDiC2IHIqnwISY_f5LAQAAALBlmtcOAAAAILk_EQEAAACvZZrXDgAAAHlL0GkBAAAAy2Wa1w4AAAA; - expires=Fri, 19-Feb-2021 17:56:27 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=ests; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.11397.13 - WUS2 ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-resource/0.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions?api-version=2019-11-01 - response: - body: - string: '{"value": [], "count": {"type": "Total", "value": 0}}' - headers: - cache-control: - - no-cache - content-length: - - '47' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:56:29 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml b/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml deleted file mode 100644 index 40e08354efd2..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_cae.test_username_password.yaml +++ /dev/null @@ -1,559 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1651' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:32:19 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLY; expires=Fri, 19-Feb-2021 17:32:19 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.11397.13 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - fpc=Aq2CQNlpjAxDssTcAilRGLY; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://login.microsoftonline.com/common/userrealm/username?api-version=1.0 - response: - body: - string: '{"ver": "1.0", "account_type": "Managed", "domain_name": "azuresdkteam.onmicrosoft.com", - "cloud_instance_name": "microsoftonline.com", "cloud_audience_urn": "urn:federation:MicrosoftOnline"}' - headers: - cache-control: - - no-store, no-cache - content-disposition: - - inline; filename=userrealm.json - content-length: - - '181' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:32:19 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLY; expires=Fri, 19-Feb-2021 17:32:20 GMT; path=/; - secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.11397.13 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '333' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - fpc=Aq2CQNlpjAxDssTcAilRGLY; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|301,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation - https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "redactedf2adbf", - "refresh_token": "redacted72e298", - "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjM2NDAsIm5iZiI6MTYxMTE2MzY0MCwiZXhwIjoxNjExMTY3NTQwLCJhaW8iOiJBVFFBeS84U0FBQUFjSU9MUjhRbmJJd0lKb1lTYkxoakhndzMrL3BEdWJaVTdlUHB1anFjQjBvMzNzQjVXRjJWV0w4bjEwWmhkM3dWIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6IjMyLWpHQW1tNkVPckVEM2J0dl9NQVEiLCJ2ZXIiOiIyLjAifQ.Selp9Tu_RXqJjKw2Jr9tlIDEO5ZDoEQmURRZyYVHHdv7VAntq6khKkxTbcWq_UMf-XQLV9_vislkdaydPzZaM8rb-9O3DDN9Mfug8s9clxWPAUu8Cv7A8qc-eMTYF7nSjZXvcDRcAINunnUeeXjYBYYa-Cm9XrVzKiXyjb9Ue4S7c42YCdE_PUgQPQq-qr_umkWmIYLa5cOB-a017vUdGQ2DOAT3scPKCwjXb2ZlSUfeVs7bXXmvzgNGaBkCe2g2m97Fbe9JCjfmsIj89D8gkYuSup7JYV6DJzw3XAXGH1f46hEAhcHhoLoVuTTbMRKhIUV_TSQpnWSvv2CrRGEBeQ", - "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '4308' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:32:20 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA; expires=Fri, 19-Feb-2021 - 17:32:20 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.11397.13 - EUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-resource/0.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions?api-version=2019-11-01 - response: - body: - string: '{"value": [], "count": {"type": "Total", "value": 0}}' - headers: - cache-control: - - no-cache - content-length: - - '47' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:32:22 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-resource/0.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions?api-version=2019-11-01 - response: - body: - string: '{"error": {"code": "AuthenticationFailed", "message": "Authentication - failed."}}' - headers: - cache-control: - - no-cache - connection: - - close - content-length: - - '76' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:39:04 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - www-authenticate: - - Bearer authorization_uri="https://login.windows.net/", error="invalid_token", - error_description="User session has been revoked", claims="eyJhY2Nlc3NfdG9rZW4iOnsibmJmIjp7ImVzc2VudGlhbCI6dHJ1ZSwgInZhbHVlIjoiMTYxMTE2NDM0NCJ9fX0=" - x-content-type-options: - - nosniff - x-ms-failure-cause: - - gateway - status: - code: 401 - message: Unauthorized -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '1460' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAA; stsservicecookie=estsfd; - x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|84,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"error": "invalid_grant", "error_description": "AADSTS50173: The provided - grant has expired due to it being revoked, a fresh auth token is needed. The - user might have changed or reset their password. The grant was issued on ''2021-01-20T17:32:20.2232320Z'' - and the TokensValidFrom date (before which tokens are not valid) for this - user is ''2021-01-20T17:32:23.0000000Z''.\r\nTrace ID: 5ee79893-4981-495d-ae90-afc983ccc901\r\nCorrelation - ID: 1f52d4cd-6545-40bb-84b2-41e4f6d70fe0\r\nTimestamp: 2021-01-20 17:39:05Z", - "error_codes": [50173], "timestamp": "2021-01-20 17:39:05Z", "trace_id": "5ee79893-4981-495d-ae90-afc983ccc901", - "correlation_id": "1f52d4cd-6545-40bb-84b2-41e4f6d70fe0", "error_uri": "https://login.microsoftonline.com/error?code=50173", - "suberror": "bad_token"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '760' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:39:04 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - expires=Fri, 19-Feb-2021 17:39:05 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,50173,0,402769.7905, - x-ms-ests-server: - - 2.1.11397.13 - EUS ProdSlices - status: - code: 400 - message: Bad Request -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=https://login.microsoftonline.com/common/oauth2/authorize - response: - body: - string: '{"tenant_discovery_endpoint": "https://login.microsoftonline.com/common/.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"]}]}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '945' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:39:04 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - expires=Fri, 19-Feb-2021 17:39:05 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.11419.13 - WUS2 ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://login.microsoftonline.com/common/userrealm/username?api-version=1.0 - response: - body: - string: '{"ver": "1.0", "account_type": "Managed", "domain_name": "azuresdkteam.onmicrosoft.com", - "cloud_instance_name": "microsoftonline.com", "cloud_audience_urn": "urn:federation:MicrosoftOnline"}' - headers: - cache-control: - - no-store, no-cache - content-disposition: - - inline; filename=userrealm.json - content-length: - - '181' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:39:04 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - expires=Fri, 19-Feb-2021 17:39:05 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.11397.13 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '414' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAABeStGSRwwnTq2vHplZ9KL41VttHWaSdWFW4op5D1v8wRYT0Le8LI-vbF7BnHd4S77mIU_zlxYknnw07xOCtnkPU-2KykWHxlYYRdnQA6vbogoL3vOKUYHDJfHb7odwv3xiSWTlEunCm4GpfWqWg3tjbjJBVxt2c8brqSulOpCUoCE5wsN-wzsrI8eVRZ23TaAgAA; - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAACNgmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.5.1 Python/3.8.0 (Windows-10-10.0.19041-SP0) - x-client-cpu: - - x86 - x-client-current-telemetry: - - 1|301,0| - x-client-os: - - win32 - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.8.0 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "https://management.azure.com/user_impersonation - https://management.azure.com/.default", "expires_in": 86399, "ext_expires_in": - 86399, "access_token": "redacted154205", - "refresh_token": "redacted5cc1a0", - "foci": "1", "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiIwNGIwNzc5NS04ZGRiLTQ2MWEtYmJlZS0wMmY5ZTFiZjdiNDYiLCJpc3MiOiJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhL3YyLjAiLCJpYXQiOjE2MTExNjQwNDUsIm5iZiI6MTYxMTE2NDA0NSwiZXhwIjoxNjExMTY3OTQ1LCJhaW8iOiJBVFFBeS84U0FBQUFLODI3b3FSMjdsMGcyRG5qM0RuR2RmeTUxcjgrZk1wYTFUb3dOK2gvMTdtdllyRHlQY0t0aTBQV0NoQ2g5TmpsIiwibmFtZSI6ImNobG93ZS10ZXN0Iiwib2lkIjoiYTcyOGM5MWEtNDdjOS00NTAyLWJhMDUtMzYwODQwODI2NjM2IiwicHJlZmVycmVkX3VzZXJuYW1lIjoiY2hsb3dlLXRlc3RAYXp1cmVzZGt0ZWFtLm9ubWljcm9zb2Z0LmNvbSIsInJoIjoiMC5BVGNBSW11Q1ZOWTRzay02MmJlNU9qNmNXcFYzc0FUYmpScEd1LTRDLWVHX2UwWTNBSkEuIiwic3ViIjoiSE5QcW9raHV6WUFmRlVlRkEtVm1rQ0M1Z253Mkp1b0xTSEtIZ2NDbkdHYyIsInRpZCI6IjU0ODI2YjIyLTM4ZDYtNGZiMi1iYWQ5LWI3YjkzYTNlOWM1YSIsInV0aSI6ImcxOTZhbTJNYlV5R0FqOE44cDdIQVEiLCJ2ZXIiOiIyLjAifQ.Uhx_g7vsHlPMQzeSbkTbeCgAVq1Yj7OWk18zJr5huT9vGX2NlFIiLJa2fUGW_thsYtSNPrmRAFCaAPD402N1-gZwFyCId0ObpmgW4m-XUXwVScGbQ4malAOIAuxX_BFQ4tLKSUzi1JWryWBvs2eBh3ZCzATGw_gJGm83TYm4Ih-QrmGULMEQP0gC0gpqvfOo2giM8via-xSh0vDTZA07ip17C5Te_IAS3AJ1ChcnJvB5uCpTLd5a-zD2fsCvK602PDtCMMZNwnbmrXVUseP_1E_3JQGRa6dfBGFq4HSdV2EvQ5s5zq_Dy3aAgpGzLQiJQgf7rzcxUd0RRHoSSLp5XQ", - "client_info": "eyJ1aWQiOiJhNzI4YzkxYS00N2M5LTQ1MDItYmEwNS0zNjA4NDA4MjY2MzYiLCJ1dGlkIjoiNTQ4MjZiMjItMzhkNi00ZmIyLWJhZDktYjdiOTNhM2U5YzVhIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '4308' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:39:05 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Aq2CQNlpjAxDssTcAilRGLaFz2TkAQAAAE9hmtcOAAAA353cAwEAAAAlYJrXDgAAAJj9_ksBAAAAuGGa1w4AAAA; - expires=Fri, 19-Feb-2021 17:39:05 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.11397.13 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-azure-mgmt-resource/0.1.0 Python/3.8.0 (Windows-10-10.0.19041-SP0) - method: GET - uri: https://management.azure.com/subscriptions?api-version=2019-11-01 - response: - body: - string: '{"value": [], "count": {"type": "Total", "value": 0}}' - headers: - cache-control: - - no-cache - content-length: - - '47' - content-type: - - application/json; charset=utf-8 - date: - - Wed, 20 Jan 2021 17:39:06 GMT - expires: - - '-1' - pragma: - - no-cache - strict-transport-security: - - max-age=31536000; includeSubDomains - vary: - - Accept-Encoding - x-content-type-options: - - nosniff - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_system_assigned.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_system_assigned.json new file mode 100644 index 000000000000..6fb736f64ad1 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_system_assigned.json @@ -0,0 +1,56 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:30 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1718", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:30 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "fe83865b-495e-4ec7-9574-12b264882c9f", + "expires_in": "86311", + "expires_on": "1643312761", + "ext_expires_in": "86399", + "not_before": "1643226061", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_system_assigned_tenant_id.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_system_assigned_tenant_id.json new file mode 100644 index 000000000000..6fb736f64ad1 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_system_assigned_tenant_id.json @@ -0,0 +1,56 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:30 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1718", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:30 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "fe83865b-495e-4ec7-9574-12b264882c9f", + "expires_in": "86311", + "expires_on": "1643312761", + "ext_expires_in": "86399", + "not_before": "1643226061", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_user_assigned.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_user_assigned.json new file mode 100644 index 000000000000..ae21b59bbd47 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_user_assigned.json @@ -0,0 +1,56 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:48:32 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1707", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:48:32 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "client-id", + "expires_in": "86315", + "expires_on": "1643312827", + "ext_expires_in": "86399", + "not_before": "1643226127", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_user_assigned_tenant_id.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_user_assigned_tenant_id.json new file mode 100644 index 000000000000..ae21b59bbd47 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.pyTestImdstest_user_assigned_tenant_id.json @@ -0,0 +1,56 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:48:32 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Connection": "keep-alive", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1707", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:48:32 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "client-id", + "expires_in": "86315", + "expires_on": "1643312827", + "ext_expires_in": "86399", + "not_before": "1643226127", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.test_system_assigned.yaml b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.test_system_assigned.yaml deleted file mode 100644 index d1a0c2f5857b..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.test_system_assigned.yaml +++ /dev/null @@ -1,41 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com - response: - body: {string: '{"error": "invalid_request", "error_description": "Required metadata - header not specified"}'} - headers: - content-length: ['88'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Apr 2021 22:13:41 GMT'] - server: [IMDS/150.870.65.492] - status: {code: 400, message: Bad Request} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Metadata: ['true'] - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com - response: - body: {string: '{"access_token": "redacted", "client_id": "e15dd129-090a-41d4-add5-bb4b16b2b1a9", - "expires_in": "86104", "expires_on": "1619561325", "ext_expires_in": "86399", - "not_before": "1619474625", "resource": "https://management.azure.com", "token_type": - "Bearer"}'} - headers: - content-length: ['1692'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Apr 2021 22:13:41 GMT'] - server: [IMDS/150.870.65.492] - status: {code: 200, message: OK} -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.test_user_assigned.yaml b/sdk/identity/azure-identity/tests/recordings/test_imds_credential.test_user_assigned.yaml deleted file mode 100644 index e8d83f155ffc..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_imds_credential.test_user_assigned.yaml +++ /dev/null @@ -1,41 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com&client_id=client-id - response: - body: {string: '{"error": "invalid_request", "error_description": "Required metadata - header not specified"}'} - headers: - content-length: ['88'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Apr 2021 22:13:41 GMT'] - server: [IMDS/150.870.65.492] - status: {code: 400, message: Bad Request} -- request: - body: null - headers: - Accept: ['*/*'] - Accept-Encoding: ['gzip, deflate'] - Connection: [keep-alive] - Metadata: ['true'] - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com&client_id=client-id - response: - body: {string: '{"access_token": "redacted", "client_id": "client-id", - "expires_in": "86400", "expires_on": "1619561622", "ext_expires_in": "86399", - "not_before": "1619474922", "resource": "https://management.azure.com", "token_type": - "Bearer"}'} - headers: - content-length: ['1712'] - content-type: [application/json; charset=utf-8] - date: ['Mon, 26 Apr 2021 22:13:41 GMT'] - server: [IMDS/150.870.65.492] - status: {code: 200, message: OK} -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_system_assigned.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_system_assigned.json new file mode 100644 index 000000000000..33b894b58963 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_system_assigned.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:46:00 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1718", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:46:01 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "fe83865b-495e-4ec7-9574-12b264882c9f", + "expires_in": "86399", + "expires_on": "1643312761", + "ext_expires_in": "86399", + "not_before": "1643226061", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_system_assigned_tenant_id.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_system_assigned_tenant_id.json new file mode 100644 index 000000000000..33b894b58963 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_system_assigned_tenant_id.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:46:00 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1718", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:46:01 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "fe83865b-495e-4ec7-9574-12b264882c9f", + "expires_in": "86399", + "expires_on": "1643312761", + "ext_expires_in": "86399", + "not_before": "1643226061", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_user_assigned.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_user_assigned.json new file mode 100644 index 000000000000..a6c35e996792 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_user_assigned.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:06 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1707", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:07 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "client-id", + "expires_in": "86400", + "expires_on": "1643312827", + "ext_expires_in": "86399", + "not_before": "1643226127", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_user_assigned_tenant_id.json b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_user_assigned_tenant_id.json new file mode 100644 index 000000000000..a6c35e996792 --- /dev/null +++ b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.pyTestImdsAsynctest_user_assigned_tenant_id.json @@ -0,0 +1,54 @@ +{ + "Entries": [ + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "88", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:06 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "error": "invalid_request", + "error_description": "Required metadata header not specified" + } + }, + { + "RequestUri": "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01\u0026resource=https://management.azure.com\u0026client_id=client-id", + "RequestMethod": "GET", + "RequestHeaders": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Metadata": "true", + "User-Agent": "azsdk-python-identity/1.8.0 Python/3.9.9 (Windows-10-10.0.19042-SP0)" + }, + "RequestBody": null, + "StatusCode": 200, + "ResponseHeaders": { + "Content-Length": "1707", + "Content-Type": "application/json; charset=utf-8", + "Date": "Wed, 26 Jan 2022 19:47:07 GMT", + "Server": "IMDS/150.870.65.528" + }, + "ResponseBody": { + "access_token": "access_token", + "client_id": "client-id", + "expires_in": "86400", + "expires_on": "1643312827", + "ext_expires_in": "86399", + "not_before": "1643226127", + "resource": "https://management.azure.com", + "token_type": "Bearer" + } + } + ], + "Variables": {} +} diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.test_system_assigned.yaml b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.test_system_assigned.yaml deleted file mode 100644 index fc9415080cfd..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.test_system_assigned.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com - response: - body: {string: '{"error": "invalid_request", "error_description": "Required metadata - header not specified"}'} - headers: {content-length: '88', content-type: application/json; charset=utf-8, - date: 'Mon, 26 Apr 2021 22:13:42 GMT', server: IMDS/150.870.65.492} - status: {code: 400, message: Bad Request} - url: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com -- request: - body: null - headers: - Metadata: ['true'] - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com - response: - body: {string: '{"access_token": "redacted", "client_id": "e15dd129-090a-41d4-add5-bb4b16b2b1a9", - "expires_in": "86102", "expires_on": "1619561325", "ext_expires_in": "86399", - "not_before": "1619474625", "resource": "https://management.azure.com", "token_type": - "Bearer"}'} - headers: {content-length: '1692', content-type: application/json; charset=utf-8, - date: 'Mon, 26 Apr 2021 22:13:42 GMT', server: IMDS/150.870.65.492} - status: {code: 200, message: OK} - url: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.test_user_assigned.yaml b/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.test_user_assigned.yaml deleted file mode 100644 index cc24c4e01071..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_imds_credential_async.test_user_assigned.yaml +++ /dev/null @@ -1,31 +0,0 @@ -interactions: -- request: - body: null - headers: - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com&client_id=client-id - response: - body: {string: '{"error": "invalid_request", "error_description": "Required metadata - header not specified"}'} - headers: {content-length: '88', content-type: application/json; charset=utf-8, - date: 'Mon, 26 Apr 2021 22:13:42 GMT', server: IMDS/150.870.65.492} - status: {code: 400, message: Bad Request} - url: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com&client_id=b48ae5dc-70d0-488a-8ef5-f30d905cd5ec -- request: - body: null - headers: - Metadata: ['true'] - User-Agent: [azsdk-python-identity/1.6.0b4 Python/3.6.9 (Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic)] - method: GET - uri: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com&client_id=client-id - response: - body: {string: '{"access_token": "redacted", "client_id": "client-id", - "expires_in": "86399", "expires_on": "1619561622", "ext_expires_in": "86399", - "not_before": "1619474922", "resource": "https://management.azure.com", "token_type": - "Bearer"}'} - headers: {content-length: '1712', content-type: application/json; charset=utf-8, - date: 'Mon, 26 Apr 2021 22:13:42 GMT', server: IMDS/150.870.65.492} - status: {code: 200, message: OK} - url: http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com&client_id=b48ae5dc-70d0-488a-8ef5-f30d905cd5ec -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_obo.test_obo.yaml b/sdk/identity/azure-identity/tests/recordings/test_obo.test_obo.yaml deleted file mode 100644 index bc4be50dc1b1..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_obo.test_obo.yaml +++ /dev/null @@ -1,323 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": - "https://login.microsoftonline.com/tenant/kerberos", "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1753' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:36 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=ApFBM5AqHPREsjrRBKdmcYg; expires=Thu, 07-Oct-2021 15:34:37 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrw58zv1OseTxmIDP6IKxe3EyNzaOoTXWBK6im1X00HSpPXTJndiRRXsBdjKBUCTs7TpDbltNyZ1S0F4c0LTIB2Ac7-qnzzHkpvCtb52GZtrEEGhV5beCfJyCHcU7zUTNuVLRMoxduC_0aIvLjf0Pb2j9w1DsqjAqGT5siqmh9cbAgAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrw58zv1OseTxmIDP6IKxe3EyNzaOoTXWBK6im1X00HSpPXTJndiRRXsBdjKBUCTs7TpDbltNyZ1S0F4c0LTIB2Ac7-qnzzHkpvCtb52GZtrEEGhV5beCfJyCHcU7zUTNuVLRMoxduC_0aIvLjf0Pb2j9w1DsqjAqGT5siqmh9cbAgAA; - fpc=ApFBM5AqHPREsjrRBKdmcYg; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/common/userrealm/username?api-version=1.0 - response: - body: - string: '{"ver": "1.0", "account_type": "Managed", "domain_name": "chlowehotmail.onmicrosoft.com", - "cloud_instance_name": "microsoftonline.com", "cloud_audience_urn": "urn:federation:MicrosoftOnline"}' - headers: - cache-control: - - no-store, no-cache - content-disposition: - - inline; filename=userrealm.json - content-length: - - '182' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:36 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApFBM5AqHPREsjrRBKdmcYg; expires=Thu, 07-Oct-2021 15:34:37 GMT; path=/; - secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '304' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrw58zv1OseTxmIDP6IKxe3EyNzaOoTXWBK6im1X00HSpPXTJndiRRXsBdjKBUCTs7TpDbltNyZ1S0F4c0LTIB2Ac7-qnzzHkpvCtb52GZtrEEGhV5beCfJyCHcU7zUTNuVLRMoxduC_0aIvLjf0Pb2j9w1DsqjAqGT5siqmh9cbAgAA; - fpc=ApFBM5AqHPREsjrRBKdmcYg; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-client-cpu: - - x64 - x-client-current-telemetry: - - 4|301,0| - x-client-last-telemetry: - - 4|0||| - x-client-os: - - linux - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.14.0 - x-ms-lib-capability: - - retry-after, h429 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3599, - "ext_expires_in": 3599, "access_token": "redacted", "refresh_token": "redacted", - "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiAiZDcwZmM1YWUtNTJlNC00ODk1LWJmMWItODk0MTAzZDdlZjE0IiwgImlzcyI6ICJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjL3YyLjAiLCAiaWF0IjogMTYzMTAyODU3NywgIm5iZiI6IDE2MzEwMjg1NzcsICJleHAiOiAxNjMxMDMyNDc3LCAibmFtZSI6ICJyZWRhY3RlZCIsICJvaWQiOiAiY2RkNmVlMjYtZTRiYS00MjRlLTgyZTUtZTdmYTc3ODNiNTgwIiwgInByZWZlcnJlZF91c2VybmFtZSI6ICJyZWRhY3RlZCIsICJyaCI6ICIwLkFSY0F0eHRqUFBlcFEwT2x1cVlWa1RYeF9LN0ZEOWZrVXBWSXZ4dUpRUVBYN3hRWEFQcy4iLCAic3ViIjogIkRFZVg1akRlVTl0NTRaQmlWdUp2S2dwVFE3Ry1hazYtamJ0Zm5oenVEWVUiLCAidGlkIjogIjNjNjMxYmI3LWE5ZjctNDM0My1hNWJhLWE2MTU5MTM1ZjFmYyIsICJ1dGkiOiAiejBzN0trZm8wRTItN1JzMVM0S25BQSIsICJ2ZXIiOiAiMi4wIn0=.XJpJJc4GhX550ivXniNfMu90dFtRIyCGUGu4hjlTRC_LQvDeRyGkPZ58lPQkxKgvlJ4e67eqes-I4OkfdKAeuobekGknCRUiB6Wkk-jb_0QTCY_iYItiGZTe6BF2N2uembtE7rIkA4cg4lcjQVGT2XXLhxri6v3lKRVB8VFoNQX2ns-ZVcGTJcYUfePp3-gGzdl4zgmXpUnBwAHcI4i1xM8ldnY8Tg_NOdm2k_7sljR_WQGbj2OajwwDp2PXOi4Bxhrx6Ido1ba8dLVCpObGhbxcMI6HqUrkmJZ3NpxyFJRXTTpDAXXe7igE1nYIDAxtfznv6xzOcsZ1ASQkFdixXQ", - "client_info": "eyJ1aWQiOiJjZGQ2ZWUyNi1lNGJhLTQyNGUtODJlNS1lN2ZhNzc4M2I1ODAiLCJ1dGlkIjoiM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '3808' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:37 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApFBM5AqHPREsjrRBKdmcYjArTo4AQAAAI19ydgOAAAA; expires=Thu, 07-Oct-2021 - 15:34:37 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.12011.8 - EUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": - "https://login.microsoftonline.com/tenant/kerberos", "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1753' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:37 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=ApIRpxWQh99Fin85MgP9rYo; expires=Thu, 07-Oct-2021 15:34:38 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrrXn0fun5smW2YybWHaGDMPIBjB3_nqNp54Ray2vCYQCFmicDNcyCjUkDMsJRVZJ6WuxQpQiWo6M_EHvtjQsOMmLqcDhGhRSBEn6VLXUzTI74SixLa8RdyYKNeR4JHnI7u-XXh1GAInRph4FJDGaUTSd9ZQp15obnTxL5RMtJZQIgAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - EUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '1797' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrrXn0fun5smW2YybWHaGDMPIBjB3_nqNp54Ray2vCYQCFmicDNcyCjUkDMsJRVZJ6WuxQpQiWo6M_EHvtjQsOMmLqcDhGhRSBEn6VLXUzTI74SixLa8RdyYKNeR4JHnI7u-XXh1GAInRph4FJDGaUTSd9ZQp15obnTxL5RMtJZQIgAA; - fpc=ApIRpxWQh99Fin85MgP9rYo; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-client-cpu: - - x64 - x-client-current-telemetry: - - 4|523,0| - x-client-last-telemetry: - - 4|0||| - x-client-os: - - linux - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.14.0 - x-ms-lib-capability: - - retry-after, h429 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3597, - "ext_expires_in": 3597, "access_token": "redacted", "refresh_token": "redacted", - "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiAiZDcwZmM1YWUtNTJlNC00ODk1LWJmMWItODk0MTAzZDdlZjE0IiwgImlzcyI6ICJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjL3YyLjAiLCAiaWF0IjogMTYzMTAyODU3OCwgIm5iZiI6IDE2MzEwMjg1NzgsICJleHAiOiAxNjMxMDMyNDc2LCAibmFtZSI6ICJyZWRhY3RlZCIsICJvaWQiOiAiY2RkNmVlMjYtZTRiYS00MjRlLTgyZTUtZTdmYTc3ODNiNTgwIiwgInByZWZlcnJlZF91c2VybmFtZSI6ICJyZWRhY3RlZCIsICJyaCI6ICIwLkFSY0F0eHRqUFBlcFEwT2x1cVlWa1RYeF9LN0ZEOWZrVXBWSXZ4dUpRUVBYN3hRWEFQcy4iLCAic3ViIjogIkRFZVg1akRlVTl0NTRaQmlWdUp2S2dwVFE3Ry1hazYtamJ0Zm5oenVEWVUiLCAidGlkIjogIjNjNjMxYmI3LWE5ZjctNDM0My1hNWJhLWE2MTU5MTM1ZjFmYyIsICJ1dGkiOiAiR3ZCZ3pmU3pfMEtiQzRuR3VJR2lBQSIsICJ2ZXIiOiAiMi4wIn0=.i20piIaQtxCfxZOomTA2TYhRW1FK3X5YXjL20lfPEsW1itPJXvYLmr0u9y_YoRa1RqreUXN8gXHNxThQyFZpOi4t4HxixlFEgY-yBH6-afH9x6ELmKnyGYbBzqDFhRAd4j3iVnBkV8VS_m_vq7lYxNpSPyhO8QqA74LtA0XrLCjM7tJUpJlJn37maKOKbttQqM4m0gMR9pO-aBeWfUxLNjL4rE3qD6PeQn5tThsViVXTdUhD1fYEK84m23ppMOwyUTmbFcd9lLk-WPNVdtxWm3xOltvpXme9PnbFj7QumIByuRaj_pO6vfJX7IyeRCWMOMg5Krn2CPet4pRuBhtw_Q", - "client_info": "eyJ1aWQiOiJjZGQ2ZWUyNi1lNGJhLTQyNGUtODJlNS1lN2ZhNzc4M2I1ODAiLCJ1dGlkIjoiM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '3817' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:37 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=ApIRpxWQh99Fin85MgP9rYpdrFyDAQAAAI59ydgOAAAA; expires=Thu, 07-Oct-2021 - 15:34:38 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_obo.test_obo_cert.yaml b/sdk/identity/azure-identity/tests/recordings/test_obo.test_obo_cert.yaml deleted file mode 100644 index ffb4149c71dc..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_obo.test_obo_cert.yaml +++ /dev/null @@ -1,323 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": - "https://login.microsoftonline.com/tenant/kerberos", "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1753' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:38 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=Al2AaHexYLBOmyGBXbNSZak; expires=Thu, 07-Oct-2021 15:34:38 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrp72HIbtYy633HfEkqbneIDSaHi4FTkQ2sTgkSDVUoZK3HWBm63Val8GR4Y6CPUFbE-Gw-lQxlTaC_0W2Ib7td_CII8zmAn_ZDJFLXDjcEfG78fTAKgWbwAPxevWJMmIZoLILpdGIKmV2Pk5GJIp2Th_-eFidwfFYKBKBiACbw_ogAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrp72HIbtYy633HfEkqbneIDSaHi4FTkQ2sTgkSDVUoZK3HWBm63Val8GR4Y6CPUFbE-Gw-lQxlTaC_0W2Ib7td_CII8zmAn_ZDJFLXDjcEfG78fTAKgWbwAPxevWJMmIZoLILpdGIKmV2Pk5GJIp2Th_-eFidwfFYKBKBiACbw_ogAA; - fpc=Al2AaHexYLBOmyGBXbNSZak; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/common/userrealm/username?api-version=1.0 - response: - body: - string: '{"ver": "1.0", "account_type": "Managed", "domain_name": "chlowehotmail.onmicrosoft.com", - "cloud_instance_name": "microsoftonline.com", "cloud_audience_urn": "urn:federation:MicrosoftOnline"}' - headers: - cache-control: - - no-store, no-cache - content-disposition: - - inline; filename=userrealm.json - content-length: - - '182' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:38 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Al2AaHexYLBOmyGBXbNSZak; expires=Thu, 07-Oct-2021 15:34:39 GMT; path=/; - secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '304' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrp72HIbtYy633HfEkqbneIDSaHi4FTkQ2sTgkSDVUoZK3HWBm63Val8GR4Y6CPUFbE-Gw-lQxlTaC_0W2Ib7td_CII8zmAn_ZDJFLXDjcEfG78fTAKgWbwAPxevWJMmIZoLILpdGIKmV2Pk5GJIp2Th_-eFidwfFYKBKBiACbw_ogAA; - fpc=Al2AaHexYLBOmyGBXbNSZak; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-client-cpu: - - x64 - x-client-current-telemetry: - - 4|301,0| - x-client-last-telemetry: - - 4|0||| - x-client-os: - - linux - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.14.0 - x-ms-lib-capability: - - retry-after, h429 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3599, - "ext_expires_in": 3599, "access_token": "redacted", "refresh_token": "redacted", - "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiAiZDcwZmM1YWUtNTJlNC00ODk1LWJmMWItODk0MTAzZDdlZjE0IiwgImlzcyI6ICJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjL3YyLjAiLCAiaWF0IjogMTYzMTAyODU3OSwgIm5iZiI6IDE2MzEwMjg1NzksICJleHAiOiAxNjMxMDMyNDc5LCAibmFtZSI6ICJyZWRhY3RlZCIsICJvaWQiOiAiY2RkNmVlMjYtZTRiYS00MjRlLTgyZTUtZTdmYTc3ODNiNTgwIiwgInByZWZlcnJlZF91c2VybmFtZSI6ICJyZWRhY3RlZCIsICJyaCI6ICIwLkFSY0F0eHRqUFBlcFEwT2x1cVlWa1RYeF9LN0ZEOWZrVXBWSXZ4dUpRUVBYN3hRWEFQcy4iLCAic3ViIjogIkRFZVg1akRlVTl0NTRaQmlWdUp2S2dwVFE3Ry1hazYtamJ0Zm5oenVEWVUiLCAidGlkIjogIjNjNjMxYmI3LWE5ZjctNDM0My1hNWJhLWE2MTU5MTM1ZjFmYyIsICJ1dGkiOiAidFdMWHhVWlJ1MHlzVkNYaUhUT19BQSIsICJ2ZXIiOiAiMi4wIn0=.LZzG9mrX8cvEtZKMq-3u15lWtN802xUPSFeBSqZLjqbjS2mgdgGS50TbHefsVYTEU0KLf3qiVpJPNXiDwDrr8qNbfcPPOw-3h4HifiEyA2Il6ViWz3UOL-KD0m-yz51V7OA5satFmOzOp8KmE_DQUWZG3PAbNCZHjJkKT2AWxYL1gJ5ssSWjTQurk4b2EHT5oJLR2MCCNOp3Xn8LMRN-0dukNYsPMH1Pgig2sDrK8AvQfi5-36yVlEa_Q_jgIpvcO_x1CwnkI_SvrRfDyMA-8DYlJObBKrRO3eZqHNPPspiqlnmXmykNguRj9S1PmWu6nnASpv6McvL3GssRfTS43g", - "client_info": "eyJ1aWQiOiJjZGQ2ZWUyNi1lNGJhLTQyNGUtODJlNS1lN2ZhNzc4M2I1ODAiLCJ1dGlkIjoiM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '3808' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:38 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Al2AaHexYLBOmyGBXbNSZanArTo4AQAAAI59ydgOAAAA; expires=Thu, 07-Oct-2021 - 15:34:39 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.12011.8 - WUS2 ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": - "https://login.microsoftonline.com/tenant/kerberos", "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1753' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:39 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=Am81GkTyMLpDhLABMqY12bw; expires=Thu, 07-Oct-2021 15:34:39 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrYgDyLdRHhzVLyIm5nrhIRBxp-0JvIy2WwDr1EnzMZaWWIvAum7UZZ4dZSmJs-QVtXBMFLKzNSl9q5mnl3tYkogQPjMPEKlcAxEVlcR4-IvoOLB3SLdOrpTMhoQaPC_WAZTjfoWhXbUAHagSeGjUSz8SBuQi-Mdf6-qebDcLvbsQgAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '2661' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrYgDyLdRHhzVLyIm5nrhIRBxp-0JvIy2WwDr1EnzMZaWWIvAum7UZZ4dZSmJs-QVtXBMFLKzNSl9q5mnl3tYkogQPjMPEKlcAxEVlcR4-IvoOLB3SLdOrpTMhoQaPC_WAZTjfoWhXbUAHagSeGjUSz8SBuQi-Mdf6-qebDcLvbsQgAA; - fpc=Am81GkTyMLpDhLABMqY12bw; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-client-cpu: - - x64 - x-client-current-telemetry: - - 4|523,0| - x-client-last-telemetry: - - 4|0||| - x-client-os: - - linux - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.14.0 - x-ms-lib-capability: - - retry-after, h429 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3597, - "ext_expires_in": 3597, "access_token": "redacted", "refresh_token": "redacted", - "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiAiZDcwZmM1YWUtNTJlNC00ODk1LWJmMWItODk0MTAzZDdlZjE0IiwgImlzcyI6ICJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjL3YyLjAiLCAiaWF0IjogMTYzMTAyODU3OSwgIm5iZiI6IDE2MzEwMjg1NzksICJleHAiOiAxNjMxMDMyNDc3LCAibmFtZSI6ICJyZWRhY3RlZCIsICJvaWQiOiAiY2RkNmVlMjYtZTRiYS00MjRlLTgyZTUtZTdmYTc3ODNiNTgwIiwgInByZWZlcnJlZF91c2VybmFtZSI6ICJyZWRhY3RlZCIsICJyaCI6ICIwLkFSY0F0eHRqUFBlcFEwT2x1cVlWa1RYeF9LN0ZEOWZrVXBWSXZ4dUpRUVBYN3hRWEFQcy4iLCAic3ViIjogIkRFZVg1akRlVTl0NTRaQmlWdUp2S2dwVFE3Ry1hazYtamJ0Zm5oenVEWVUiLCAidGlkIjogIjNjNjMxYmI3LWE5ZjctNDM0My1hNWJhLWE2MTU5MTM1ZjFmYyIsICJ1dGkiOiAiWjZPUlVkQ2p3VS15NVJfa2ZfbkNBQSIsICJ2ZXIiOiAiMi4wIn0=.d-dX0Fceo1kgEULk0ir7ulkXMc0z944EFvqZcBjJhSpKT0tToAcRcjBAVR9wU8UWGc6KU6SLACS0OjvC7lvki3B0lmqzenEsTOydUSxFiDLqp7yR3bXSnQsxx_zsgLRpLXng5gknkrPpU5TcmYPdO9okEj9ACfo_PiWFCi-D04Q56NiuxbdD-juBmY1lUpaFxbnhG-jhP0mtAno9mVGHx1gPK9m_7S5DxcSt3B_4WqmoPd-aH383yIHu-oFf0qioXy1fQ6HmChRw0oTl3y8_nrCNtxTT75i-0BBCiQrioTZHQNCeTIlzEVoJYUc9dJ9LayBnMdVXTIrSUKzx91yHmA", - "client_info": "eyJ1aWQiOiJjZGQ2ZWUyNi1lNGJhLTQyNGUtODJlNS1lN2ZhNzc4M2I1ODAiLCJ1dGlkIjoiM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '3817' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:39 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=Am81GkTyMLpDhLABMqY12bxdrFyDAQAAAI99ydgOAAAA; expires=Thu, 07-Oct-2021 - 15:34:40 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.12011.8 - WUS2 ProdSlices - status: - code: 200 - message: OK -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_obo_async.test_obo.yaml b/sdk/identity/azure-identity/tests/recordings/test_obo_async.test_obo.yaml deleted file mode 100644 index 3b7dc683f4f5..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_obo_async.test_obo.yaml +++ /dev/null @@ -1,217 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": - "https://login.microsoftonline.com/tenant/kerberos", "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1753' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:39 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=AkVp-nifqNhNrK-o5WlRLus; expires=Thu, 07-Oct-2021 15:34:40 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAoM9_0t_0GJ15W1lpZ-D0uWhfGg_MkH339D-uSEYPiMZ7nLLAZJfleEkxDaybudbGq-xJ7h17Bct8xancmp9U53Pr3wxGhju1L2JkgwCWxc0A-ChUboI_J2MPZN796kkqIAlYUOFkS_2prH_Xx6ddQr_IGI1EXcgVAPzFrgEnp8gAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAoM9_0t_0GJ15W1lpZ-D0uWhfGg_MkH339D-uSEYPiMZ7nLLAZJfleEkxDaybudbGq-xJ7h17Bct8xancmp9U53Pr3wxGhju1L2JkgwCWxc0A-ChUboI_J2MPZN796kkqIAlYUOFkS_2prH_Xx6ddQr_IGI1EXcgVAPzFrgEnp8gAA; - fpc=AkVp-nifqNhNrK-o5WlRLus; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/common/userrealm/username?api-version=1.0 - response: - body: - string: '{"ver": "1.0", "account_type": "Managed", "domain_name": "chlowehotmail.onmicrosoft.com", - "cloud_instance_name": "microsoftonline.com", "cloud_audience_urn": "urn:federation:MicrosoftOnline"}' - headers: - cache-control: - - no-store, no-cache - content-disposition: - - inline; filename=userrealm.json - content-length: - - '182' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:39 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=AkVp-nifqNhNrK-o5WlRLus; expires=Thu, 07-Oct-2021 15:34:40 GMT; path=/; - secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '304' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrAoM9_0t_0GJ15W1lpZ-D0uWhfGg_MkH339D-uSEYPiMZ7nLLAZJfleEkxDaybudbGq-xJ7h17Bct8xancmp9U53Pr3wxGhju1L2JkgwCWxc0A-ChUboI_J2MPZN796kkqIAlYUOFkS_2prH_Xx6ddQr_IGI1EXcgVAPzFrgEnp8gAA; - fpc=AkVp-nifqNhNrK-o5WlRLus; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-client-cpu: - - x64 - x-client-current-telemetry: - - 4|301,0| - x-client-last-telemetry: - - 4|0||| - x-client-os: - - linux - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.14.0 - x-ms-lib-capability: - - retry-after, h429 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3599, - "ext_expires_in": 3599, "access_token": "redacted", "refresh_token": "redacted", - "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiAiZDcwZmM1YWUtNTJlNC00ODk1LWJmMWItODk0MTAzZDdlZjE0IiwgImlzcyI6ICJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjL3YyLjAiLCAiaWF0IjogMTYzMTAyODU4MCwgIm5iZiI6IDE2MzEwMjg1ODAsICJleHAiOiAxNjMxMDMyNDgwLCAibmFtZSI6ICJyZWRhY3RlZCIsICJvaWQiOiAiY2RkNmVlMjYtZTRiYS00MjRlLTgyZTUtZTdmYTc3ODNiNTgwIiwgInByZWZlcnJlZF91c2VybmFtZSI6ICJyZWRhY3RlZCIsICJyaCI6ICIwLkFSY0F0eHRqUFBlcFEwT2x1cVlWa1RYeF9LN0ZEOWZrVXBWSXZ4dUpRUVBYN3hRWEFQcy4iLCAic3ViIjogIkRFZVg1akRlVTl0NTRaQmlWdUp2S2dwVFE3Ry1hazYtamJ0Zm5oenVEWVUiLCAidGlkIjogIjNjNjMxYmI3LWE5ZjctNDM0My1hNWJhLWE2MTU5MTM1ZjFmYyIsICJ1dGkiOiAiR2xWcGpBeXM0MGFLVG9rU3RUQ0ZBQSIsICJ2ZXIiOiAiMi4wIn0=.Ogm8BBsmdpspPksOJ0RLHd3QjQSQzEW76vyRAG_lolJzFZYAWhoTXtm_IhnPvG0W9cL1WjyVKNZuiWBVUJHDDljwz8Pt2By-l8WxiiLY_WhkZJviniNQwPkd2uSeD33XCvy1Ip4KnCHuUkLpp0VSr0jTH0HArd8Otsg2F9NK3MOCFUc3cEfJLa8I4s42iEDQ6eu4G7f-Kt__-pHC4BddTQraUjJAY-7b1K0nSG89-3fyIwLRacDhpHw03yukf6SGjbMPEB-LsSUbMoPU9dZbe8u4lRiWe6il0WeoG8rMiyHqgD8LwuTWNqE-wRXJNtPzis6B6WTjZV7dT3Tj7NTXYw", - "client_info": "eyJ1aWQiOiJjZGQ2ZWUyNi1lNGJhLTQyNGUtODJlNS1lN2ZhNzc4M2I1ODAiLCJ1dGlkIjoiM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '3808' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:40 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=AkVp-nifqNhNrK-o5WlRLuvArTo4AQAAAI99ydgOAAAA; expires=Thu, 07-Oct-2021 - 15:34:40 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.12011.8 - NCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Content-Type: - - application/x-www-form-urlencoded - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3597, - "ext_expires_in": 3597, "access_token": "redacted", "refresh_token": "redacted"}' - headers: - cache-control: no-store, no-cache - content-length: '2548' - content-type: application/json; charset=utf-8 - date: Tue, 07 Sep 2021 15:34:41 GMT - expires: '-1' - p3p: CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: no-cache - set-cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: max-age=31536000; includeSubDomains - x-content-type-options: nosniff - x-ms-ests-server: 2.1.12011.8 - NCUS ProdSlices - status: - code: 200 - message: OK - url: https://login.microsoftonline.com/3c631bb7-a9f7-4343-a5ba-a6159135f1fc/oauth2/v2.0/token -version: 1 diff --git a/sdk/identity/azure-identity/tests/recordings/test_obo_async.test_obo_cert.yaml b/sdk/identity/azure-identity/tests/recordings/test_obo_async.test_obo_cert.yaml deleted file mode 100644 index fba51f37ae84..000000000000 --- a/sdk/identity/azure-identity/tests/recordings/test_obo_async.test_obo_cert.yaml +++ /dev/null @@ -1,217 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - '*/*' - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/tenant/v2.0/.well-known/openid-configuration - response: - body: - string: '{"token_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "private_key_jwt", - "client_secret_basic"], "jwks_uri": "https://login.microsoftonline.com/tenant/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/tenant/v2.0", - "request_uri_parameter_supported": false, "userinfo_endpoint": "https://graph.microsoft.com/oidc/userinfo", - "authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize", - "device_authorization_endpoint": "https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode", - "http_logout_supported": true, "frontchannel_logout_supported": true, "end_session_endpoint": - "https://login.microsoftonline.com/tenant/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_username", - "name", "tid", "ver", "at_hash", "c_hash", "email"], "kerberos_endpoint": - "https://login.microsoftonline.com/tenant/kerberos", "tenant_region_scope": - "NA", "cloud_instance_name": "microsoftonline.com", "cloud_graph_host_name": - "graph.windows.net", "msgraph_host": "graph.microsoft.com", "rbac_url": "https://pas.windows.net"}' - headers: - access-control-allow-methods: - - GET, OPTIONS - access-control-allow-origin: - - '*' - cache-control: - - max-age=86400, private - content-length: - - '1753' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:41 GMT - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - set-cookie: - - fpc=AscTiiYYQWVMpKXCD2-do-Y; expires=Thu, 07-Oct-2021 15:34:41 GMT; path=/; - secure; HttpOnly; SameSite=None - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrLqYaybmCG6x4tCDVGB-IQYn93xEPbA3d-Y_krue4ZC1dqQzK75NOlqL5ePjAZt0RJ-PmGaxoR4EM2is09NqQ9VdR8xamgbrhWspt8OpqV0Q0ClPINBDGD4PibjYURhzZkR_L1sKLBnzsWZ2ONROMV3nL7GUPWGUS1711Ml20_bIgAA; - domain=.login.microsoftonline.com; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - WUS2 ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrLqYaybmCG6x4tCDVGB-IQYn93xEPbA3d-Y_krue4ZC1dqQzK75NOlqL5ePjAZt0RJ-PmGaxoR4EM2is09NqQ9VdR8xamgbrhWspt8OpqV0Q0ClPINBDGD4PibjYURhzZkR_L1sKLBnzsWZ2ONROMV3nL7GUPWGUS1711Ml20_bIgAA; - fpc=AscTiiYYQWVMpKXCD2-do-Y; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: GET - uri: https://login.microsoftonline.com/common/userrealm/username?api-version=1.0 - response: - body: - string: '{"ver": "1.0", "account_type": "Managed", "domain_name": "chlowehotmail.onmicrosoft.com", - "cloud_instance_name": "microsoftonline.com", "cloud_audience_urn": "urn:federation:MicrosoftOnline"}' - headers: - cache-control: - - no-store, no-cache - content-disposition: - - inline; filename=userrealm.json - content-length: - - '182' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:41 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=AscTiiYYQWVMpKXCD2-do-Y; expires=Thu, 07-Oct-2021 15:34:42 GMT; path=/; - secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-ests-server: - - 2.1.12011.8 - WUS2 ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - Connection: - - keep-alive - Content-Length: - - '304' - Content-Type: - - application/x-www-form-urlencoded - Cookie: - - esctx=AQABAAAAAAD--DLA3VO7QrddgJg7WevrLqYaybmCG6x4tCDVGB-IQYn93xEPbA3d-Y_krue4ZC1dqQzK75NOlqL5ePjAZt0RJ-PmGaxoR4EM2is09NqQ9VdR8xamgbrhWspt8OpqV0Q0ClPINBDGD4PibjYURhzZkR_L1sKLBnzsWZ2ONROMV3nL7GUPWGUS1711Ml20_bIgAA; - fpc=AscTiiYYQWVMpKXCD2-do-Y; stsservicecookie=estsfd; x-ms-gateway-slice=estsfd - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - x-client-cpu: - - x64 - x-client-current-telemetry: - - 4|301,0| - x-client-last-telemetry: - - 4|0||| - x-client-os: - - linux - x-client-sku: - - MSAL.Python - x-client-ver: - - 1.14.0 - x-ms-lib-capability: - - retry-after, h429 - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3599, - "ext_expires_in": 3599, "access_token": "redacted", "refresh_token": "redacted", - "id_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im5PbzNaRHJPRFhFSzFqS1doWHNsSFJfS1hFZyJ9.eyJhdWQiOiAiZDcwZmM1YWUtNTJlNC00ODk1LWJmMWItODk0MTAzZDdlZjE0IiwgImlzcyI6ICJodHRwczovL2xvZ2luLm1pY3Jvc29mdG9ubGluZS5jb20vM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjL3YyLjAiLCAiaWF0IjogMTYzMTAyODU4MiwgIm5iZiI6IDE2MzEwMjg1ODIsICJleHAiOiAxNjMxMDMyNDgyLCAibmFtZSI6ICJyZWRhY3RlZCIsICJvaWQiOiAiY2RkNmVlMjYtZTRiYS00MjRlLTgyZTUtZTdmYTc3ODNiNTgwIiwgInByZWZlcnJlZF91c2VybmFtZSI6ICJyZWRhY3RlZCIsICJyaCI6ICIwLkFSY0F0eHRqUFBlcFEwT2x1cVlWa1RYeF9LN0ZEOWZrVXBWSXZ4dUpRUVBYN3hRWEFQcy4iLCAic3ViIjogIkRFZVg1akRlVTl0NTRaQmlWdUp2S2dwVFE3Ry1hazYtamJ0Zm5oenVEWVUiLCAidGlkIjogIjNjNjMxYmI3LWE5ZjctNDM0My1hNWJhLWE2MTU5MTM1ZjFmYyIsICJ1dGkiOiAiOEUwbElqb2hvMFdvaV9UX1BvYW5BQSIsICJ2ZXIiOiAiMi4wIn0=.N7bDidZlRU_o-FrIu5YMNZj9Yf5NZ1kk2sqJRRW_6ibwRF0kHMqFD8sa4txWDBkc4rJt33gpsvXNHREC0CzTgg77MiH_JO5DRZlBoyyju13qUCDP8KodTWdFIul3J3f-ZrIo897QzFU_GznV2MwR9Ed2ASU7pGwS_ps9hjB5I9FDMvotenilysmh0Q125c7I4SLZE7ujDSaU3nWW_XzG0NVPS_hhRxk2fp5GDIMiqliF3faP3py5AyKgNrVoNEkkmlzBqbpsdYqgPSeDlmmp-tIEDG9d7ybjBVYeGbVDZCvn2J5rXbtEHqEmGsyP9F7e1302Eqh3gJVb-Dg9putpNQ", - "client_info": "eyJ1aWQiOiJjZGQ2ZWUyNi1lNGJhLTQyNGUtODJlNS1lN2ZhNzc4M2I1ODAiLCJ1dGlkIjoiM2M2MzFiYjctYTlmNy00MzQzLWE1YmEtYTYxNTkxMzVmMWZjIn0"}' - headers: - cache-control: - - no-store, no-cache - content-length: - - '3808' - content-type: - - application/json; charset=utf-8 - date: - - Tue, 07 Sep 2021 15:34:42 GMT - expires: - - '-1' - p3p: - - CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: - - no-cache - set-cookie: - - fpc=AscTiiYYQWVMpKXCD2-do-bArTo4AQAAAJF9ydgOAAAA; expires=Thu, 07-Oct-2021 - 15:34:42 GMT; path=/; secure; HttpOnly; SameSite=None - - x-ms-gateway-slice=estsfd; path=/; secure; samesite=none; httponly - - stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: - - max-age=31536000; includeSubDomains - x-content-type-options: - - nosniff - x-ms-clitelem: - - 1,0,0,, - x-ms-ests-server: - - 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK -- request: - body: null - headers: - Content-Type: - - application/x-www-form-urlencoded - User-Agent: - - azsdk-python-identity/1.7.0b4 Python/3.8.10 (Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-glibc2.29) - method: POST - uri: https://login.microsoftonline.com/tenant/oauth2/v2.0/token - response: - body: - string: '{"token_type": "Bearer", "scope": "api://foo/Foo", "expires_in": 3597, - "ext_expires_in": 3597, "access_token": "redacted", "refresh_token": "redacted"}' - headers: - cache-control: no-store, no-cache - content-length: '2548' - content-type: application/json; charset=utf-8 - date: Tue, 07 Sep 2021 15:34:43 GMT - expires: '-1' - p3p: CP="DSP CUR OTPi IND OTRi ONL FIN" - pragma: no-cache - set-cookie: stsservicecookie=estsfd; path=/; secure; samesite=none; httponly - strict-transport-security: max-age=31536000; includeSubDomains - x-content-type-options: nosniff - x-ms-ests-server: 2.1.12011.8 - SCUS ProdSlices - status: - code: 200 - message: OK - url: https://login.microsoftonline.com/3c631bb7-a9f7-4343-a5ba-a6159135f1fc/oauth2/v2.0/token -version: 1 diff --git a/sdk/identity/azure-identity/tests/test_app_service.py b/sdk/identity/azure-identity/tests/test_app_service.py index ae3beb673d2d..8ce3963c651e 100644 --- a/sdk/identity/azure-identity/tests/test_app_service.py +++ b/sdk/identity/azure-identity/tests/test_app_service.py @@ -10,20 +10,17 @@ from helpers import mock from recorded_test_case import RecordedTestCase +from devtools_testutils import is_live, recorded_by_proxy PLAYBACK_URL = "https://msi-endpoint/token" -class RecordedTests(RecordedTestCase): - def __init__(self, *args, **kwargs): - super(RecordedTests, self).__init__(*args, **kwargs) - - if self.is_live: - url = os.environ.get(EnvironmentVariables.IDENTITY_ENDPOINT) - if not (url and EnvironmentVariables.IDENTITY_HEADER in os.environ): - pytest.skip("Recording requires values for $IDENTITY_ENDPOINT and $IDENTITY_HEADER") - else: - self.scrubber.register_name_pair(url, PLAYBACK_URL) +class TestAppService(RecordedTestCase): + def load_settings(self): + if is_live(): + url = os.environ.get(EnvironmentVariables.MSI_ENDPOINT) + if not (url and EnvironmentVariables.MSI_SECRET in os.environ): + pytest.skip("Recording requires values for $MSI_ENDPOINT and $MSI_SECRET") self.patch = mock.MagicMock() # no need to patch anything when recording else: # in playback we need to set environment variables and clear any that would interfere @@ -31,13 +28,18 @@ def __init__(self, *args, **kwargs): env = {EnvironmentVariables.IDENTITY_ENDPOINT: PLAYBACK_URL, EnvironmentVariables.IDENTITY_HEADER: "redacted"} self.patch = mock.patch.dict(os.environ, env, clear=True) + @pytest.mark.manual + @recorded_by_proxy def test_system_assigned(self): + self.load_settings() with self.patch: credential = AppServiceCredential() token = credential.get_token(self.scope) assert token.token assert isinstance(token.expires_on, int) + @pytest.mark.manual + @recorded_by_proxy def test_system_assigned_tenant_id(self): with self.patch: credential = AppServiceCredential() @@ -45,14 +47,19 @@ def test_system_assigned_tenant_id(self): assert token.token assert isinstance(token.expires_on, int) + @pytest.mark.manual @pytest.mark.usefixtures("user_assigned_identity_client_id") + @recorded_by_proxy def test_user_assigned(self): + self.load_settings() with self.patch: credential = AppServiceCredential(client_id=self.user_assigned_identity_client_id) token = credential.get_token(self.scope) assert token.token assert isinstance(token.expires_on, int) + @pytest.mark.manual + @recorded_by_proxy @pytest.mark.usefixtures("user_assigned_identity_client_id") def test_user_assigned_tenant_id(self): with self.patch: diff --git a/sdk/identity/azure-identity/tests/test_app_service_async.py b/sdk/identity/azure-identity/tests/test_app_service_async.py index e671cdfb2006..0543dc60d1a7 100644 --- a/sdk/identity/azure-identity/tests/test_app_service_async.py +++ b/sdk/identity/azure-identity/tests/test_app_service_async.py @@ -8,22 +8,20 @@ from azure.identity.aio._credentials.app_service import AppServiceCredential from azure.identity._constants import EnvironmentVariables import pytest +from devtools_testutils import is_live +from devtools_testutils.aio import recorded_by_proxy_async from helpers_async import await_test from recorded_test_case import RecordedTestCase from test_app_service import PLAYBACK_URL -class RecordedTests(RecordedTestCase): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - - if self.is_live: - url = os.environ.get(EnvironmentVariables.IDENTITY_ENDPOINT) - if not (url and EnvironmentVariables.IDENTITY_HEADER in os.environ): - pytest.skip("Recording requires values for $IDENTITY_ENDPOINT and $IDENTITY_HEADER") - else: - self.scrubber.register_name_pair(url, PLAYBACK_URL) +class TestAppServiceAsync(RecordedTestCase): + def load_settings(self): + if is_live(): + url = os.environ.get(EnvironmentVariables.MSI_ENDPOINT) + if not (url and EnvironmentVariables.MSI_SECRET in os.environ): + pytest.skip("Recording requires values for $MSI_ENDPOINT and $MSI_SECRET") self.patch = mock.MagicMock() # no need to patch anything when recording else: # in playback we need to set environment variables and clear any that would interfere @@ -31,15 +29,20 @@ def __init__(self, *args, **kwargs): env = {EnvironmentVariables.IDENTITY_ENDPOINT: PLAYBACK_URL, EnvironmentVariables.IDENTITY_HEADER: "redacted"} self.patch = mock.patch.dict(os.environ, env, clear=True) + @pytest.mark.manual @await_test + @recorded_by_proxy_async async def test_system_assigned(self): + self.load_settings() with self.patch: credential = AppServiceCredential() token = await credential.get_token(self.scope) assert token.token assert isinstance(token.expires_on, int) + @pytest.mark.manual @await_test + @recorded_by_proxy_async async def test_system_assigned_tenant_id(self): with self.patch: credential = AppServiceCredential() @@ -47,17 +50,22 @@ async def test_system_assigned_tenant_id(self): assert token.token assert isinstance(token.expires_on, int) + @pytest.mark.manual @pytest.mark.usefixtures("user_assigned_identity_client_id") @await_test + @recorded_by_proxy_async async def test_user_assigned(self): + self.load_settings() with self.patch: credential = AppServiceCredential(client_id=self.user_assigned_identity_client_id) token = await credential.get_token(self.scope) assert token.token assert isinstance(token.expires_on, int) + @pytest.mark.manual @pytest.mark.usefixtures("user_assigned_identity_client_id") @await_test + @recorded_by_proxy_async async def test_user_assigned_tenant_id(self): with self.patch: credential = AppServiceCredential(client_id=self.user_assigned_identity_client_id) diff --git a/sdk/identity/azure-identity/tests/test_cae.py b/sdk/identity/azure-identity/tests/test_cae.py index b8da9b6b0d26..d910016ae8e8 100644 --- a/sdk/identity/azure-identity/tests/test_cae.py +++ b/sdk/identity/azure-identity/tests/test_cae.py @@ -7,8 +7,6 @@ import os import time -from azure.core.pipeline.transport import HttpRequest -from azure.core.exceptions import ResourceNotFoundError from azure.identity import ( AzureAuthorityHosts, DeviceCodeCredential, @@ -17,27 +15,12 @@ ) from azure.identity._constants import DEVELOPER_SIGN_ON_CLIENT_ID from azure.mgmt.resource.subscriptions import SubscriptionClient -from azure_devtools.scenario_tests import GeneralNameReplacer, RequestUrlNormalizer, patch_time_sleep_api -from devtools_testutils import AzureTestCase +from devtools_testutils import AzureRecordedTestCase, is_live, recorded_by_proxy import pytest -import requests -from six.moves.urllib_parse import urlparse -from recording_processors import IdTokenProcessor, RecordingRedactor - - -@pytest.mark.skip("these tests require support in azure-core") -class CaeTestCase(AzureTestCase): - def __init__(self, *args, **kwargs): - scrubber = GeneralNameReplacer() - super(CaeTestCase, self).__init__( - *args, - recording_processors=[RecordingRedactor(record_unique_values=True), scrubber], - replay_processors=[RequestUrlNormalizer(), IdTokenProcessor()], - **kwargs - ) - self.scrubber = scrubber - if self.is_live: +class CaePreparer(object): + def __init__(self): + if is_live(): if "CAE_TENANT_ID" not in os.environ: pytest.skip("Missing a tenant ID for CAE tests") if "CAE_ARM_URL" not in os.environ: @@ -52,10 +35,6 @@ def __init__(self, *args, **kwargs): "tenant_id": os.environ["CAE_TENANT_ID"], "username": os.environ.get("CAE_USERNAME"), } - real = urlparse(self.cae_settings["arm_url"]) - self.scrubber.register_name_pair(real.netloc, "management.azure.com") - self.scrubber.register_name_pair(self.cae_settings["tenant_id"], "tenant") - self.scrubber.register_name_pair(self.cae_settings["username"], "username") else: self.cae_settings = { "arm_scope": "https://management.azure.com/.default", @@ -65,8 +44,14 @@ def __init__(self, *args, **kwargs): "tenant_id": "tenant", "username": "username", } - self.replay_patches.append(patch_time_sleep_api) + def __call__(self, fn): + def _preparer_wrapper(test_class): + fn(test_class, cae_settings=self.cae_settings) + return _preparer_wrapper + +@pytest.mark.skip("these tests require support in azure-core") +class TestCae(AzureRecordedTestCase): def cae_test(self, credential): client = SubscriptionClient(credential, base_url=self.cae_settings["arm_url"]) @@ -74,7 +59,7 @@ def cae_test(self, credential): list(client.subscriptions.list()) first_token = credential.get_token(self.cae_settings["arm_scope"]) - if self.is_live: + if is_live(): validate_ssm_token(first_token.token) # revoking sessions revokes access and refresh tokens @@ -100,19 +85,26 @@ def cae_test(self, credential): @pytest.mark.manual def test_browser(self): + self.load_settings() credential = InteractiveBrowserCredential( authority=self.cae_settings["authority"], tenant_id=self.cae_settings["tenant_id"] ) - self.cae_test(credential) + self.cae_test(credential, cae_settings=self.cae_settings) + @pytest.mark.manual + @recorded_by_proxy def test_device_code(self): + self.load_settings() credential = DeviceCodeCredential( authority=self.cae_settings["authority"], tenant_id=self.cae_settings["tenant_id"] ) self.cae_test(credential) + @pytest.mark.manual + @recorded_by_proxy def test_username_password(self): - if self.is_live and not ("username" in self.cae_settings and "password" in self.cae_settings): + self.load_settings() + if is_live() and not ("username" in self.cae_settings and "password" in self.cae_settings): pytest.skip("Missing a username or password for CAE test") credential = UsernamePasswordCredential( @@ -124,6 +116,32 @@ def test_username_password(self): ) self.cae_test(credential) + def load_settings(self): + if is_live(): + if "CAE_TENANT_ID" not in os.environ: + pytest.skip("Missing a tenant ID for CAE tests") + if "CAE_ARM_URL" not in os.environ: + pytest.skip("Missing an ARM URL for CAE tests") + + self.cae_settings = { + "arm_scope": os.environ.get("CAE_ARM_SCOPE", "https://management.azure.com/.default"), + "arm_url": os.environ["CAE_ARM_URL"], + "authority": os.environ.get("CAE_AUTHORITY", AzureAuthorityHosts.AZURE_PUBLIC_CLOUD), + "graph_url": os.environ.get("CAE_GRAPH_URL", "https://graph.microsoft.com"), + "password": os.environ.get("CAE_PASSWORD"), + "tenant_id": os.environ["CAE_TENANT_ID"], + "username": os.environ.get("CAE_USERNAME"), + } + else: + self.cae_settings = { + "arm_scope": "https://management.azure.com/.default", + "arm_url": "https://management.azure.com/", + "authority": AzureAuthorityHosts.AZURE_PUBLIC_CLOUD, + "password": "password", + "tenant_id": "tenant", + "username": "username", + } + def validate_ssm_token(access_token): """Ensure an access token is enabled for smart session management i.e. it is subject to CAE""" diff --git a/sdk/identity/azure-identity/tests/test_certificate_credential.py b/sdk/identity/azure-identity/tests/test_certificate_credential.py index fab3326a52a0..56d56728df72 100644 --- a/sdk/identity/azure-identity/tests/test_certificate_credential.py +++ b/sdk/identity/azure-identity/tests/test_certificate_credential.py @@ -163,14 +163,14 @@ def test_regional_authority(): mock_confidential_client.reset_mock() # region can be configured via environment variable - with patch.dict("os.environ", {EnvironmentVariables.AZURE_REGIONAL_AUTHORITY_NAME: region}, clear=True): + with patch.dict("os.environ", {EnvironmentVariables.AZURE_REGIONAL_AUTHORITY_NAME: region.value}, clear=True): credential = CertificateCredential("tenant", "client-id", PEM_CERT_PATH) with patch("msal.ConfidentialClientApplication", mock_confidential_client): credential.get_token("scope") assert mock_confidential_client.call_count == 1 _, kwargs = mock_confidential_client.call_args - assert kwargs["azure_region"] == region + assert kwargs["azure_region"] == region.value def test_requires_certificate(): diff --git a/sdk/identity/azure-identity/tests/test_client_secret_credential.py b/sdk/identity/azure-identity/tests/test_client_secret_credential.py index aaf460056335..acd204670a8d 100644 --- a/sdk/identity/azure-identity/tests/test_client_secret_credential.py +++ b/sdk/identity/azure-identity/tests/test_client_secret_credential.py @@ -129,14 +129,14 @@ def test_regional_authority(): mock_confidential_client.reset_mock() # region can be configured via environment variable - with patch.dict("os.environ", {EnvironmentVariables.AZURE_REGIONAL_AUTHORITY_NAME: region}, clear=True): + with patch.dict("os.environ", {EnvironmentVariables.AZURE_REGIONAL_AUTHORITY_NAME: region.value}, clear=True): credential = ClientSecretCredential("tenant", "client-id", "secret") with patch("msal.ConfidentialClientApplication", mock_confidential_client): credential.get_token("scope") assert mock_confidential_client.call_count == 1 _, kwargs = mock_confidential_client.call_args - assert kwargs["azure_region"] == region + assert kwargs["azure_region"] == region.value def test_token_cache(): diff --git a/sdk/identity/azure-identity/tests/test_imds_credential.py b/sdk/identity/azure-identity/tests/test_imds_credential.py index dded40983ca8..7eec40eb9bae 100644 --- a/sdk/identity/azure-identity/tests/test_imds_credential.py +++ b/sdk/identity/azure-identity/tests/test_imds_credential.py @@ -5,6 +5,7 @@ import json import time +from devtools_testutils import recorded_by_proxy from azure.core.credentials import AccessToken from azure.core.exceptions import ClientAuthenticationError @@ -215,13 +216,15 @@ def test_imds_authority_override(): @pytest.mark.usefixtures("record_imds_test") -class RecordedTests(RecordedTestCase): +class TestImds(RecordedTestCase): + @recorded_by_proxy def test_system_assigned(self): credential = ImdsCredential() token = credential.get_token(self.scope) assert token.token assert isinstance(token.expires_on, int) + @recorded_by_proxy def test_system_assigned_tenant_id(self): credential = ImdsCredential() token = credential.get_token(self.scope, tenant_id="tenant_id") @@ -229,6 +232,7 @@ def test_system_assigned_tenant_id(self): assert isinstance(token.expires_on, int) @pytest.mark.usefixtures("user_assigned_identity_client_id") + @recorded_by_proxy def test_user_assigned(self): credential = ImdsCredential(client_id=self.user_assigned_identity_client_id) token = credential.get_token(self.scope) @@ -236,6 +240,7 @@ def test_user_assigned(self): assert isinstance(token.expires_on, int) @pytest.mark.usefixtures("user_assigned_identity_client_id") + @recorded_by_proxy def test_user_assigned_tenant_id(self): credential = ImdsCredential(client_id=self.user_assigned_identity_client_id) token = credential.get_token(self.scope, tenant_id="tenant_id") diff --git a/sdk/identity/azure-identity/tests/test_imds_credential_async.py b/sdk/identity/azure-identity/tests/test_imds_credential_async.py index 50327cadb739..d8f13e62cfb9 100644 --- a/sdk/identity/azure-identity/tests/test_imds_credential_async.py +++ b/sdk/identity/azure-identity/tests/test_imds_credential_async.py @@ -6,6 +6,7 @@ import time from unittest import mock +from devtools_testutils.aio import recorded_by_proxy_async from azure.core.credentials import AccessToken from azure.core.exceptions import ClientAuthenticationError from azure.identity import CredentialUnavailableError @@ -250,8 +251,9 @@ async def test_imds_authority_override(): @pytest.mark.usefixtures("record_imds_test") -class RecordedTests(RecordedTestCase): +class TestImdsAsync(RecordedTestCase): @await_test + @recorded_by_proxy_async async def test_system_assigned(self): credential = ImdsCredential() token = await credential.get_token(self.scope) @@ -259,6 +261,7 @@ async def test_system_assigned(self): assert isinstance(token.expires_on, int) @await_test + @recorded_by_proxy_async async def test_system_assigned_tenant_id(self): credential = ImdsCredential() token = await credential.get_token(self.scope, tenant_id="tenant_id") @@ -267,6 +270,7 @@ async def test_system_assigned_tenant_id(self): @pytest.mark.usefixtures("user_assigned_identity_client_id") @await_test + @recorded_by_proxy_async async def test_user_assigned(self): credential = ImdsCredential(client_id=self.user_assigned_identity_client_id) token = await credential.get_token(self.scope) @@ -275,6 +279,7 @@ async def test_user_assigned(self): @pytest.mark.usefixtures("user_assigned_identity_client_id") @await_test + @recorded_by_proxy_async async def test_user_assigned_tenant_id(self): credential = ImdsCredential(client_id=self.user_assigned_identity_client_id) token = await credential.get_token(self.scope, tenant_id="tenant_id") diff --git a/sdk/identity/azure-identity/tests/test_obo.py b/sdk/identity/azure-identity/tests/test_obo.py index 70ee13ced413..58b676590a73 100644 --- a/sdk/identity/azure-identity/tests/test_obo.py +++ b/sdk/identity/azure-identity/tests/test_obo.py @@ -14,37 +14,32 @@ from azure.identity._constants import EnvironmentVariables from azure.identity._internal.user_agent import USER_AGENT import pytest -import six -from six.moves.urllib_parse import urlparse +from urllib.parse import urlparse from helpers import build_aad_response, FAKE_CLIENT_ID, get_discovery_response, mock_response from recorded_test_case import RecordedTestCase from test_certificate_credential import PEM_CERT_PATH +from devtools_testutils import is_live, recorded_by_proxy + +missing_variables = [ + var + for var in ( + "OBO_CERT_BYTES", + "OBO_CLIENT_ID", + "OBO_CLIENT_SECRET", + "OBO_PASSWORD", + "OBO_SCOPE", + "OBO_TENANT_ID", + "OBO_USERNAME", + ) + if var not in os.environ +] - -class OboRecordedTestCase(RecordedTestCase): - def __init__(self, *args, **kwargs): - super(OboRecordedTestCase, self).__init__(*args, **kwargs) - - if self.is_live: - missing_variables = [ - var - for var in ( - "OBO_CERT_BYTES", - "OBO_CLIENT_ID", - "OBO_CLIENT_SECRET", - "OBO_PASSWORD", - "OBO_SCOPE", - "OBO_TENANT_ID", - "OBO_USERNAME", - ) - if var not in os.environ - ] - if any(missing_variables): - pytest.skip("No value for environment variables: " + ", ".join(missing_variables)) - +class TestObo(RecordedTestCase): + def load_settings(self): + if is_live(): self.obo_settings = { - "cert_bytes": six.ensure_binary(os.environ["OBO_CERT_BYTES"]), + "cert_bytes": os.environ["OBO_CERT_BYTES"], "client_id": os.environ["OBO_CLIENT_ID"], "client_secret": os.environ["OBO_CLIENT_SECRET"], "password": os.environ["OBO_PASSWORD"], @@ -52,10 +47,6 @@ def __init__(self, *args, **kwargs): "tenant_id": os.environ["OBO_TENANT_ID"], "username": os.environ["OBO_USERNAME"], } - - self.scrubber.register_name_pair(self.obo_settings["tenant_id"], "tenant") - self.scrubber.register_name_pair(self.obo_settings["username"], "username") - else: self.obo_settings = { "cert_bytes": open(PEM_CERT_PATH, "rb").read(), @@ -67,9 +58,11 @@ def __init__(self, *args, **kwargs): "username": "username", } - -class RecordedTests(OboRecordedTestCase): + @pytest.mark.manual + @pytest.mark.skipif(any(missing_variables), reason="No value for environment variables") + @recorded_by_proxy def test_obo(self): + self.load_settings() client_id = self.obo_settings["client_id"] tenant_id = self.obo_settings["tenant_id"] @@ -80,7 +73,11 @@ def test_obo(self): credential = OnBehalfOfCredential(tenant_id, client_id, client_secret=self.obo_settings["client_secret"], user_assertion=assertion) credential.get_token(self.obo_settings["scope"]) + @pytest.mark.manual + @pytest.mark.skipif(any(missing_variables), reason="No value for environment variables") + @recorded_by_proxy def test_obo_cert(self): + self.load_settings() client_id = self.obo_settings["client_id"] tenant_id = self.obo_settings["tenant_id"] diff --git a/sdk/identity/azure-identity/tests/test_obo_async.py b/sdk/identity/azure-identity/tests/test_obo_async.py index 442e96335fb0..7a30e96fe872 100644 --- a/sdk/identity/azure-identity/tests/test_obo_async.py +++ b/sdk/identity/azure-identity/tests/test_obo_async.py @@ -2,9 +2,13 @@ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ +import os from urllib.parse import urlparse from unittest.mock import Mock, patch +from test_certificate_credential import PEM_CERT_PATH +from devtools_testutils import is_live +from devtools_testutils.aio import recorded_by_proxy_async from azure.core.pipeline.policies import ContentDecodePolicy, SansIOHTTPPolicy from azure.identity import UsernamePasswordCredential from azure.identity._constants import EnvironmentVariables @@ -12,15 +16,54 @@ from azure.identity.aio import OnBehalfOfCredential import pytest -from helpers import build_aad_response, get_discovery_response, mock_response +from helpers import build_aad_response, get_discovery_response, mock_response, FAKE_CLIENT_ID from helpers_async import AsyncMockTransport from recorded_test_case import RecordedTestCase -from test_obo import OboRecordedTestCase - -class RecordedTests(OboRecordedTestCase): +missing_variables = [ + var + for var in ( + "OBO_CERT_BYTES", + "OBO_CLIENT_ID", + "OBO_CLIENT_SECRET", + "OBO_PASSWORD", + "OBO_SCOPE", + "OBO_TENANT_ID", + "OBO_USERNAME", + ) + if var not in os.environ +] + +class TestOboAsync(RecordedTestCase): + def load_settings(self): + if is_live(): + self.obo_settings = { + "cert_bytes": os.environ["OBO_CERT_BYTES"], + "client_id": os.environ["OBO_CLIENT_ID"], + "client_secret": os.environ["OBO_CLIENT_SECRET"], + "password": os.environ["OBO_PASSWORD"], + "scope": os.environ["OBO_SCOPE"], + "tenant_id": os.environ["OBO_TENANT_ID"], + "username": os.environ["OBO_USERNAME"], + } + else: + self.obo_settings = { + "cert_bytes": open(PEM_CERT_PATH, "rb").read(), + "client_id": FAKE_CLIENT_ID, + "client_secret": "secret", + "password": "fake-password", + "scope": "api://scope", + "tenant_id": "tenant", + "username": "username", + } + + + @pytest.mark.manual + @pytest.mark.skipif(any(missing_variables), reason="No value for environment variables") @RecordedTestCase.await_prepared_test + @recorded_by_proxy_async async def test_obo(self): + self.load_settings() client_id = self.obo_settings["client_id"] client_secret = self.obo_settings["client_secret"] tenant_id = self.obo_settings["tenant_id"] @@ -32,8 +75,12 @@ async def test_obo(self): credential = OnBehalfOfCredential(tenant_id, client_id, client_secret=client_secret, user_assertion=assertion) await credential.get_token(self.obo_settings["scope"]) + @pytest.mark.manual + @pytest.mark.skipif(any(missing_variables), reason="No value for environment variables") @RecordedTestCase.await_prepared_test + @recorded_by_proxy_async async def test_obo_cert(self): + self.load_settings() client_id = self.obo_settings["client_id"] tenant_id = self.obo_settings["tenant_id"] diff --git a/sdk/identity/ci.yml b/sdk/identity/ci.yml index 37c1ead5389b..63109309e7df 100644 --- a/sdk/identity/ci.yml +++ b/sdk/identity/ci.yml @@ -35,6 +35,7 @@ extends: Path: sdk/identity/platform-matrix.json Selection: sparse GenerateVMJobs: true + TestProxy: true Artifacts: - name: azure-identity safeName: azureidentity diff --git a/sdk/identity/tests.yml b/sdk/identity/tests.yml index 88e4b32f2004..cbb21492e337 100644 --- a/sdk/identity/tests.yml +++ b/sdk/identity/tests.yml @@ -13,3 +13,5 @@ stages: PEM_CONTENT_PASSWORD_PROTECTED: $(python-identity-certificate-with-password) PFX_CONTENT: $(python-identity-certificate-pfx) PFX_CONTENT_PASSWORD_PROTECTED: $(python-identity-certificate-with-password-pfx) + AZURE_TEST_RUN_LIVE: true + AZURE_SKIP_LIVE_RECORDING: 'True'