Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Add login with API Access Token #583

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bvoilar
Copy link

@bvoilar bvoilar commented Nov 1, 2023

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>
    

Add support for authentication using API Access Tokens as described in
[Generate an API Access Token][1]. The authentication follows RFC6749
(OAuth 2.0). If the `user` argument of the login cli command 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][2].

[1]: https://docs.vmware.com/en/VMware-Cloud-Director/10.4/VMware-Cloud-Director-Tenant-Portal-Guide/GUID-A1B3B2FA-7B2C-4EE1-9D1B-188BE703EEDE.html
[2]: https://docs.vmware.com/en/VMware-Cloud-Director/10.5/VMware-Cloud-Director-Service-Provider-Admin-Guide/GUID-3326986B-931C-4FDE-AF47-D5A863191072.html

Signed-off-by: Martin Fleischer <[email protected]>
@vmwclabot
Copy link

@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
Copy link

@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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants