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

Take TokenCredential instead of bearer token #426

Closed
thovoll opened this issue Oct 20, 2021 · 3 comments
Closed

Take TokenCredential instead of bearer token #426

thovoll opened this issue Oct 20, 2021 · 3 comments
Labels
Azure.Identity The azure_identity crate

Comments

@thovoll
Copy link
Contributor

thovoll commented Oct 20, 2021

All our SDKs take an endpoint and a credential, which is almost always a TokenCredential define in azure_core, with implementations like DefaultAzureCredential in azure_identity. This is laid out in our guidelines.

I recommend taking a look at what we've done for our other Azure SDKs - any packages starting with "azure*" (as opposed to "microsoft.azure*" or something). I'm not sure about data lake specifically, but for storage in general we already have good examples you should match (type names, method names besides casing, param names, etc. - something we all do across official languages):

For example,

Specific to authentication, the TokenCredential is responsible for authenticating the user and getting a token. How that is attached to your request is up to you (and we have some helps in azure_core that may help, though not as many built out as with our other languages). In general, you should not roll your own authentication. Some libraries will, in addition, take a connection string. Follow whatever official languages are doing for guidance in those cases, though.

Originally posted by @heaths in #358 (comment)

@cataggar
Copy link
Member

@thovoll, can you provide examples where this applies? I thought TokenCredential was being used.

@cataggar cataggar added the Azure.Identity The azure_identity crate label Oct 26, 2021
@thovoll
Copy link
Contributor Author

thovoll commented Oct 27, 2021

Yes, for example here: https://github.com/thovoll/azure-sdk-for-rust/blob/cf5bf36f7714979e84ee61f2f29cc7ff1cbb07f0/sdk/storage/src/data_lake/clients/data_lake_client.rs#L20

Currently takes a String, but should take a TokenCredential.

@cataggar
Copy link
Member

cataggar commented Jul 5, 2022

Support for TokenCredential was added

@cataggar cataggar closed this as completed Jul 5, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Azure.Identity The azure_identity crate
Projects
None yet
Development

No branches or pull requests

2 participants