Skip to content

Add auxiliary authorization support for Azure cross tenant. - #884

Merged
yaohaizh merged 3 commits into
masterfrom
auxiliary_tokens
Nov 7, 2019
Merged

Add auxiliary authorization support for Azure cross tenant.#884
yaohaizh merged 3 commits into
masterfrom
auxiliary_tokens

Conversation

@yaohaizh

@yaohaizh yaohaizh commented Nov 4, 2019

Copy link
Copy Markdown

No description provided.


@SuppressWarnings("unchecked")
@Override
public T withAuxiliaryTokens(AzureTokenCredentials... tokens) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be named withAuxiliaryCredentials(AzureTokenCredentials... credentials)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed


@Override
public Response intercept(Chain chain) throws IOException {
if (this.tokens == null || this.tokens.length == 0) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we try chain.proceed(chain.request() first and only authenticate the auxiliary credentials if a certain error comes back? This will avoid unnecessary network calls for method calls not requiring auxiliary tokens.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed. LinkedAuthorizationFailed will throw at the first spot.

@yaohaizh

yaohaizh commented Nov 5, 2019

Copy link
Copy Markdown
Author

@jianghaolu thanks, resolved the review feedback.

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