Skip to content

Conversation

@schaabs
Copy link
Contributor

@schaabs schaabs commented Sep 14, 2022

Relaxes scope validation to allow '_' character, for common scopes such as user_impersonation

Fixes #30647

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

{
private const string DefaultSuffix = "/.default";
private const string ScopePattern = "^[0-9a-zA-Z-.:/]+$";
private const string ScopePattern = "^[0-9a-zA-Z-_.:/]+$";
Copy link
Member

Choose a reason for hiding this comment

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

Should this validation be used for all sub-process based credentials? It looks like only Cli and Powershell use it today.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it should, although it might not be at the moment. Also, when I made this update, I did a brief investigation I found that there are other possible scope characters that this regex is still not supporting. We need to do a deeper investigation of both, but given that we have 2 customers blocked by this, and user_impersonation is such a common scope, I think we should push out this minor fix although it might be incomplete. I created a new issue #31170, to track what work remains here.

@schaabs schaabs merged commit 927b214 into Azure:hotfix/identity/1.6.1 Sep 15, 2022
schaabs added a commit that referenced this pull request Sep 20, 2022
* [Identity] Adding AdditionallyAllowedTenants to constrain multi-tenant auth (#31037)

* [Identity] Adding AdditionallyAllowedTenants to constrain multi-tenant auth

* updating API spec

* adding dev-time credentials

* adding user-auth credentials

* refactor additional tenants to base options

* adding default and environment credentials

* update/add tests

* update API spec

* update changelog and breaking_changes

* update assembly version

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Heath Stewart <[email protected]>

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Heath Stewart <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeCredentialOptions.cs

Co-authored-by: Christopher Scott <[email protected]>

* Update sdk/identity/Azure.Identity/src/TenantIdResolver.cs

Co-authored-by: Christopher Scott <[email protected]>

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Heath Stewart <[email protected]>

* fb

* fb

* fb

* fb

* fb

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/ClientAssertionCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AzureCliCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/TokenCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/ClientSecretCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/ClientCertificateCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* updating troubleshooting.md

* update snippets

* undo snippet indent

Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Christopher Scott <[email protected]>
Co-authored-by: Scott Addie <[email protected]>

* [Identity] Updating scope validation (#31154)

* Identity Updating docs for 1.7.0 release (#31251)

* Identity Updating docs for 1.7.0 release

* update release date

* re-add DAC devcred timeout test coverage

* fix formatting issues introduced by merge

* update api spec

Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Christopher Scott <[email protected]>
Co-authored-by: Scott Addie <[email protected]>
sofiar-msft pushed a commit to sofiar-msft/azure-sdk-for-net that referenced this pull request Dec 7, 2022
…1258)

* [Identity] Adding AdditionallyAllowedTenants to constrain multi-tenant auth (Azure#31037)

* [Identity] Adding AdditionallyAllowedTenants to constrain multi-tenant auth

* updating API spec

* adding dev-time credentials

* adding user-auth credentials

* refactor additional tenants to base options

* adding default and environment credentials

* update/add tests

* update API spec

* update changelog and breaking_changes

* update assembly version

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Heath Stewart <[email protected]>

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Heath Stewart <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AuthorizationCodeCredentialOptions.cs

Co-authored-by: Christopher Scott <[email protected]>

* Update sdk/identity/Azure.Identity/src/TenantIdResolver.cs

Co-authored-by: Christopher Scott <[email protected]>

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Heath Stewart <[email protected]>

* fb

* fb

* fb

* fb

* fb

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/ClientAssertionCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AzurePowerShellCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/AzureCliCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/CHANGELOG.md

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/VisualStudioCodeCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/TokenCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/UsernamePasswordCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/OnBehalfOfCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/InteractiveBrowserCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DeviceCodeCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/DefaultAzureCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/ClientSecretCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* Update sdk/identity/Azure.Identity/src/Credentials/ClientCertificateCredentialOptions.cs

Co-authored-by: Scott Addie <[email protected]>

* updating troubleshooting.md

* update snippets

* undo snippet indent

Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Christopher Scott <[email protected]>
Co-authored-by: Scott Addie <[email protected]>

* [Identity] Updating scope validation (Azure#31154)

* Identity Updating docs for 1.7.0 release (Azure#31251)

* Identity Updating docs for 1.7.0 release

* update release date

* re-add DAC devcred timeout test coverage

* fix formatting issues introduced by merge

* update api spec

Co-authored-by: Heath Stewart <[email protected]>
Co-authored-by: Christopher Scott <[email protected]>
Co-authored-by: Scott Addie <[email protected]>
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.

3 participants