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

[Storage] Investigate OAuth2 scopes for storage clients #5097

Closed
jeremymeng opened this issue Sep 11, 2019 · 7 comments
Closed

[Storage] Investigate OAuth2 scopes for storage clients #5097

jeremymeng opened this issue Sep 11, 2019 · 7 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)

Comments

@jeremymeng
Copy link
Member

Currently we use a scope of https://storage.azure.com/.default for storage clients

example: https://github.com/azure/azure-sdk-for-js/blob/feature%2Fstorage/sdk/storage/storage-blob/src/Pipeline.ts#L232

Is it possible to have other scopes (e.g., for different Azure stack).

@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Sep 11, 2019
@jeremymeng
Copy link
Member Author

It probably should be an array of strings that users can customize.

@XiaoningLiu
Copy link
Member

@jeremymeng
Copy link
Member Author

jeremymeng commented Sep 27, 2019

@XiaoningLiu It was moved to

export const DefaultStorageScope: string = "https://storage.azure.com/.default";
. It looks specific to storage. I saw some sample C# code that has it as a string array.

@jeremymeng
Copy link
Member Author

I was thinking that there might be other possible values for the scope. If not we can close this issue.

@XiaoningLiu
Copy link
Member

XiaoningLiu commented Sep 30, 2019

I'm thinking scope variables should be provided by customer when creating token credentials. Is this limitation from @azure/identity?

    if (!isAnonymousCreds) {
      factories[2] = isTokenCredential(credential)	      factories[2] = isTokenCredential(credential)
        ? bearerTokenAuthenticationPolicy(credential, "https://storage.azure.com/.default")	        ? bearerTokenAuthenticationPolicy(credential, DefaultStorageScope)
        : credential;	        : credential;
    }	    }

@jeremymeng
Copy link
Member Author

I'm thinking scope variables should be provided by customer when creating token credentials. Is this limitation from @azure/identity?

@daviwil do you have more insights?

@jeremymeng
Copy link
Member Author

@XiaoningLiu In the future we might provide a global preset of known default settings in @azure/identity to be used by various SDK libraries. At this point it is better to have a option on the client to specify the default one for storage and allow customization later.

jeremymeng added a commit to jeremymeng/azure-sdk-for-js that referenced this issue Oct 3, 2019
so they can be customized for different Azure stacks.

Resolves Azure#5097.
jeremymeng added a commit that referenced this issue Oct 3, 2019
so they can be customized for different Azure stacks.

Resolves #5097.
@jeremymeng jeremymeng self-assigned this Oct 3, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

2 participants