vcd-cli icon indicating copy to clipboard operation
vcd-cli copied to clipboard

Add login with API Access Token

Open bvoilar opened this issue 2 years ago • 3 comments

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>
    

bvoilar avatar Nov 01 '23 14:11 bvoilar

@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 avatar Nov 01 '23 14:11 vmwclabot

@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 avatar Nov 29 '23 08:11 vmwclabot

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

vmwclabot avatar Nov 30 '23 08:11 vmwclabot