vmware-archive / vcd-cli

Command Line Interface for VMware vCloud Director
https://vmware.github.io/vcd-cli
Other
165 stars 108 forks source link

Add login with API Access Token #583

Open bvoilar opened 1 year ago

bvoilar commented 1 year ago

Description

Add support for authentication using API Access Tokens. The authentication follows RFC6749 (OAuth 2.0). If the user argument of the login cli is set to "api_token" the session-id is interpreted as API Access Token. An oAuth 2.0 authentication request is made to the token endpoint and the access_token from the response is used as session-id. Furthermore, the pyvcloud client's rehydrate_from_token function must be called with the optional argument is_jwt_token=True.

API Access Token authentication is useful when vCloud Director is configured to authenticate through an external identity provider.

Implements feature request: #581

Usage

  1. Generate an API Access Token
  2. Login with the generated API Access Token
    vcd login <VCD_HOST> <VCD_ORG> api_token --session-id <API_ACCESS_TOKEN>
vmwclabot commented 1 year ago

@buvoilajar, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

vmwclabot commented 1 year ago

@buvoilajar, we have received your signed contributor license agreement. The review is usually completed within a week, but may take longer under certain circumstances. Another comment will be added to the pull request to notify you when the merge can proceed.

vmwclabot commented 1 year ago

@buvoilajar, VMware has approved your signed contributor license agreement.