PowerCLI Reference

New-VcsOAuthSecurityContext

Synopsis

Creates an OAuth2 security context object that you can use to authenticate a user with any VMware Cloud Service.

Syntax

New-VcsOAuthSecurityContext [[-VcsServer] <String>] -ApiToken <SecureString> [-IgnoreSslValidationErrors] [<CommonParameters>]

Related Commands

Online Version

Detailed Description

Creates an OAuth2 security context object that you can use to authenticate a user with any VMware Cloud Service.


For more information about security contexts, see the about_security_context article.


This command authenticates the user who operates with the API token from the VMware Cloud Services web portal.

Parameters

NameTypeDescriptionRequired?Pipeline InputDefault Value
VcsServerStringSpecifies the host name of the VMware Cloud Services API endpoint for the particular instance. The default value is `console.cloud.vmware.com`. You can find the value for your particular instance in the Developer Center section of the VMware Cloud Services web portal.falseFalse
ApiTokenSecureStringSpecifies the API token you want to use for authentication with the VMware Cloud Services server. The token is obtained from the VMware Cloud Services web portal.trueFalse
IgnoreSslValidationErrorsSwitchParameterIf specified, any errors with the SSL certificate of the server are ignored.falseFalse

Return Type

VMware.VimAutomation.Vmc.Types.V1.VcsOAuthSecurityContext

Notes

Examples

-------------------------- Example 1 --------------------------

$oauthCtx = New-VcsOAuthSecurityContext -ApiToken "a3f35067-80b5-44f0-a0bc-e19f2bc17fb7"

Creates an OAuth2 security context object by authenticating the user with an API token from the VMware Cloud Services web portal.

-------------------------- Example 2 --------------------------

$oauthCtx = New-VcsOAuthSecurityContext -VcsServer "console.cloud.vmware.com" -ApiToken "a3f35067-80b5-44f0-a0bc-e19f2bc17fb7"

Creates an OAuth2 security context object by authenticating the user with an API token from the VMware Cloud Services web portal for a particular instance of the service. In this example, that is the public commercial instance at https://console.cloud.vmware.com.


Copyright © VMware, Inc. All rights reserved.