Skip to content

A PoC of support SSH Cert inside Cloud Shell#4641

Closed
rayluo wants to merge 1 commit intoAzure:mainfrom
rayluo:patch-1
Closed

A PoC of support SSH Cert inside Cloud Shell#4641
rayluo wants to merge 1 commit intoAzure:mainfrom
rayluo:patch-1

Conversation

@rayluo
Copy link

@rayluo rayluo commented Apr 6, 2022

This is a proof-of-concept to acquire SSH Cert from inside Cloud Shell.

Prerequisite: An MSAL prototype from this PR AzureAD/microsoft-authentication-library-for-python#420

@jiasli

@yonzhan
Copy link
Collaborator

yonzhan commented Apr 6, 2022

support SSH Cert

@yonzhan yonzhan requested a review from jiasli April 6, 2022 22:53
@yonzhan yonzhan added this to the Backlog milestone Apr 6, 2022
credential, _, _ = profile.get_login_credentials(subscription_id=profile.get_subscription()["id"])
certificatedata = credential.get_token(*scopes, data=data)
certificate = certificatedata.token
if RUNNING_INSIDE_CLOUDSHELL:
Copy link
Member

@jiasli jiasli Apr 7, 2022

Choose a reason for hiding this comment

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

Running inside Cloud Shell doesn't mean this is a Cloud Shell account. User may manually run az login to override the Cloud Shell account.

It seems we can't bypass CLI core, which has more checks

https://github.com/Azure/azure-cli/blob/d331edf76e5866cda1e6e9641d935256fc4f03ff/src/azure-cli-core/azure/cli/core/_profile.py#L319-L320

        if in_cloud_console() and account[_USER_ENTITY].get(_CLOUD_SHELL_ID):

@rayluo
Copy link
Author

rayluo commented Apr 22, 2022

Replaced by Azure/azure-cli#22162

@rayluo rayluo closed this Apr 22, 2022
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