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

Fix missing client_id in payload error when using only an Azure username and password #1409

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

kmj251
Copy link
Contributor

@kmj251 kmj251 commented Jan 17, 2024

SUMMARY

Fix code that does not set a default client_id correctly when only the ad_user and password are provided for authentication.

The code will now attempt to set the client_id to self.credentials.get('client_id'), if that value is None because it was not passed in, it will set client_id to a default value.

Fixes #1408

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

azure_rm_common.py

ADDITIONAL INFORMATION
Modules will now execute when a user only provides an Azure username and password.

@kmj251 kmj251 changed the title Fixes #1408 Fix missing client_id in payload error when using only an Azure username and password Jan 17, 2024
@Fred-sun
Copy link
Collaborator

@kmj251 Thank you very much for your contribution, this is indeed a necessary modification!

@Fred-sun Fred-sun added ready_for_review The PR has been modified and can be reviewed and merged medium_priority Medium priority high_priority High priority and removed medium_priority Medium priority labels Jan 17, 2024
@xuzhang3 xuzhang3 merged commit 4c824bf into ansible-collections:dev Jan 18, 2024
@ericsysmin
Copy link
Contributor

Any eta on a patch release as we hit this issue as well?

@Fred-sun
Copy link
Collaborator

@ericsysmin We can't confirm this yet, but we will release it as soon as possible. Thank you!

@ericsysmin
Copy link
Contributor

Bug was introduced. credentialss is not valid

@@ -1491,7 +1491,9 @@ def __init__(self, auth_source=None, profile=None, subscription_id=None, client_
authority=self._adfs_authority_url)

elif self.credentials.get('ad_user') is not None and self.credentials.get('password') is not None:
client_id = self.credentials.get('client_id', '04b07795-8ddb-461a-bbee-02f9e1bf7b46')
client_id = self.credentialss.get('client_id')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

client_id = self.credentialss.get('client_id')

needs to be

client_id = self.credentials.get('client_id')

@kmj251
Copy link
Contributor Author

kmj251 commented Jan 25, 2024

@ericsysmin Thanks for catching that! I have a new PR to fix the typo.

@Fred-sun Can you please merge PR #1424 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high_priority High priority ready_for_review The PR has been modified and can be reviewed and merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authenticating to Azure using Azure usernamd and password fails
4 participants