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

[Core] Support custom client ID for user authentication #30302

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/azure-cli-core/azure/cli/core/_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,9 @@ def _create_identity_instance(cli_ctx, authority, tenant_id=None, client_id=None
# PREVIEW: In Azure Stack environment, use core.instance_discovery=false to disable MSAL's instance discovery.
instance_discovery = cli_ctx.config.getboolean('core', 'instance_discovery', True)

# EXPERIMENTAL: Use a custom client ID for user authentication
client_id = client_id or cli_ctx.config.get('core', 'client_id', fallback=None)

return Identity(authority, tenant_id=tenant_id, client_id=client_id,
encrypt=encrypt,
use_msal_http_cache=use_msal_http_cache,
Expand Down