Skip to content

use TokenCredential in services #59

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

Merged
merged 7 commits into from
Oct 26, 2020
Merged

Conversation

ctaggart
Copy link
Contributor

Please review for #53. I made these changes manually to update cargo run --example group_create so that it works with TokenCredential. Once we figure out the design, I'll update the AutoRust code gen.

@ctaggart ctaggart requested a review from rylev October 22, 2020 13:44
@@ -34,7 +34,7 @@ async-trait = "0.1.36"
oauth2 = { version = "4.0.0-alpha.2" }

[dev-dependencies]
tokio = "0.3"
tokio = "0.2"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got some runtime errors regarding the hyper dependency. I think we may need to wait for hyper to upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created #60 to track upgrading.

pub bearer_access_token: Option<String>,
pub bearer_access_token: Option<String>, // TODO remove
pub token_credential: Option<Box<dyn azure_core::TokenCredential>>,
pub token_credential_scope: String,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Shouldn't it be a list of scopes?
https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-acquire-cache-tokens#scopes-when-acquiring-tokens
For v2.0, it is still in the scope http query param, but it is a space separated list. Let's looks and see what other SDKs do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added an issue to review this in the not too distant future: #61

@ctaggart ctaggart marked this pull request as ready for review October 23, 2020 00:33
@ctaggart
Copy link
Contributor Author

It may be easiest to review the AutoRust changes for this in ctaggart/autorust#69.

@ctaggart
Copy link
Contributor Author

@rylev, can I get an approval of this one?

@rylev rylev merged commit 10e48f6 into Azure:master Oct 26, 2020
@ctaggart ctaggart deleted the TokenCredential branch October 26, 2020 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants