-
Notifications
You must be signed in to change notification settings - Fork 71
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
Proposed fixes for token-based auth in azure fileshare service #820
Conversation
Want to add that I haven't been able to test this fully on my side yet.
|
mlos_bench/mlos_bench/services/types/azure_authenticator_type.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure we initialize before invoking get_credential()
credential = self._auth_service.get_credential() | ||
assert isinstance( | ||
credential, TokenCredential | ||
), f"Expected a TokenCredential, but got {type(credential)} instead." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still a late runtime error that I was trying to turn into a config load error in #819
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I made a new change to #819 to handle that now.
From what I can tell the rest of this one is good, but it'd be good to get confirmation that DefaultCredential
doesn't need refreshed, especially with the SP part.
To use token-based authentication for
ShareClient
, I think we should be passing in the credential object derived fromTokenCredential
(in our case, some instance ofDefaultAzureCredential
.Previously, we were passing specific string tokens to the
credential
argument, which is being intepreted as a SAS token.This leads to errors like:
azure.core.exceptions.ClientAuthenticationError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
ShareClient documentation on the
credential
argument.By passing in the whole
TokenCredential
object, I believeShareClient
will manage the token lifecycle and we won't need to do so as mentioned in #818.