Change the scope in the authentication challenge to match the (Python) SDK requirements.
The scope should be on the form https://vault.azure.net/.default. More info on scopes Here.
Here is the code in the python SDK that requires this:
The scope is parsed as a url on line 116, and it is compared against the request URL on line 121.
-
Testing required outside of automated testing?
Here is a small test example using the azure.keyvaylt.secrets library:
from azure.core.credentials import AccessToken, TokenCredential
from azure.keyvault.secrets import SecretClient
class LocalCredential(TokenCredential):
def get_token(self, *args, **kwargs) -> AccessToken:
return AccessToken("eyJhbGciOiJub25lIn0.eyJzdWIiOiIxIn0.", 9223372036854775807)
s = SecretClient("https://localhost.vault.azure.net:5551", LocalCredential())
print(s.get_secret("foo").value)
Previously it would give me the error
The challenge contains invalid scope 'foobar'.
[ ] Not Applicable
Screenshots (if appropriate):
[x] Not Applicable
Rollback / Rollforward Procedure
[ ] Roll Forward
[ ] Roll Back
Reviewer Checklist
[ ] Description of Change
[ ] Description of outside testing if applicable.
[ ] Description of Roll Forward / Backward Procedure
Description
Change the scope in the authentication challenge to match the (Python) SDK requirements.
The scope should be on the form
https://vault.azure.net/.default
. More info on scopes Here.Here is the code in the python SDK that requires this: The scope is parsed as a url on line 116, and it is compared against the request URL on line 121.
-
Testing required outside of automated testing?
Here is a small test example using the azure.keyvaylt.secrets library:
Previously it would give me the error
Screenshots (if appropriate):
Rollback / Rollforward Procedure
Reviewer Checklist