Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Identity raising a TypeError when using ClientSecretCredential #38386

Open
joshuathompsonlindley opened this issue Nov 7, 2024 · 5 comments
Assignees
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@joshuathompsonlindley
Copy link

  • Package Name: azure-identity
  • Package Version: 1.16.1
  • Operating System: Debian 12
  • Python Version: 3.11.9

Describe the bug
We are noticing a TypeError being raised within the azure-identity when a customer is trying to add Azure App Registration credentials. We're sending the following as part of the request to the ClientSecretCredential class:

  • Tenant ID
  • Client ID
  • Client Secret

We've tried to reproduce with our own credentials, to no success, and the credentials are accepted by the SDK. We've worked with the customer to ensure they are generating those secret values from the App Registration correctly, and can confirm there is no difference between our own credentials and theirs.

Expected behavior
We would expect no TypeError to be raised, and the credentials to be acquired and returned by the Azure SDK.

Additional context

[2024-10-15 08:07:16,164 /api/v2/clouds localhost ERROR/4554/0] Traceback (most recent call last):
  File "azure/identity/_internal/decorators.py", line 79, in wrapper
  File "azure/identity/_internal/client_credential_base.py", line 27, in _acquire_token_silently
  File "azure/identity/_internal/msal_credentials.py", line 106, in _get_app
  File "msal/application.py", line 608, in __init__
  File "msal/authority.py", line 79, in __init__
  File "msal/authority.py", line 210, in tenant_discovery
  File "msal/individual_cache.py", line 269, in wrapper
  File "azure/identity/_internal/msal_client.py", line 111, in get
  File "azure/identity/_internal/msal_client.py", line 133, in _store_auth_error
TypeError: string indices must be integers, not 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "flask/app.py", line 870, in full_dispatch_request
  File "flask/app.py", line 855, in dispatch_request
  File "v2/system/decorators.py", line 55, in decorated_function
  File "v2/auth/decorators.py", line 47, in wrapper
  File "flask/views.py", line 110, in view
  File "flask/views.py", line 191, in dispatch_request
  File "flask_openapi/core/decorators.py", line 118, in wrapper
    return function(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "v2/clouds/views.py", line 53, in post
  File "marshmallow/schema.py", line 722, in load
  File "marshmallow/schema.py", line 884, in _do_load
  File "marshmallow/schema.py", line 1185, in _invoke_schema_validators
  File "marshmallow/schema.py", line 774, in _run_validator
  File "v2/clouds/schemas.py", line 69, in validate_azure_credentials
  File "cloud/azure/utils.py", line 80, in validate_azure_credential_authentication
    raise AzureCredentialsInstantiationException(str(exc))
@github-actions github-actions bot added Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 7, 2024
Copy link

github-actions bot commented Nov 7, 2024

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@xiangyan99
Copy link
Member

Thanks for reaching out.

Could you enable logging and share the tracing information?

You can add code like

import logging
logging.basicConfig(level=logging.DEBUG)

Please redact the secrets.

@xiangyan99 xiangyan99 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Nov 8, 2024
@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 8, 2024
Copy link

github-actions bot commented Nov 8, 2024

Hi @joshuathompsonlindley. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@joshuathompsonlindley
Copy link
Author

Hi, thanks. We're co-ordinating with the customer on getting the tracing information.

Will update the ticket when we hear back.

@github-actions github-actions bot added needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-author-feedback Workflow: More information is needed from author to address the issue. labels Nov 11, 2024
@xiangyan99 xiangyan99 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Nov 11, 2024
Copy link

Hi @joshuathompsonlindley. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions github-actions bot removed the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Identity Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
Status: Untriaged
Development

No branches or pull requests

2 participants