New-VcsOAuthSecurityContext

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

Syntax

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

Parameters

Required Parameter Name Type Position Features Description
required
ApiToken
SecureString named Specifies 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.
optional
IgnoreSslValidationErrors
SwitchParameter named If specified, any errors with the SSL certificate of the server are ignored.
optional
VcsServer
String named
  • wildcards
  • Specifies 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.

    -AppId  <String>
    -AppSecret  <SecureString>
    -OrganizationId  <String>
    -RedirectUrl  <Uri>
    [-IgnoreSslValidationErrors]
    [-VcsServer  <String>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    AppId
    String named Specifies the ID of an OAuth App registered in the VMware Cloud Services web portal.
    required
    AppSecret
    SecureString named Specifies the secret of an OAuth App registered in the VMware Cloud Services web portal. You can retrieve the secret from the portal only when you create the application.
    required
    OrganizationId
    String named Specifies the ID of the organization where the access tokens from the security context are valid for. You can see the organization ID in the VMware Cloud Services web portal.
    required
    RedirectUrl
    Uri named Specifies the Redirect URL of the Web App that you created in the VMware Cloud Services web portal for PowerCLI. This URL must be on localhost and a free port on the machine where PowerCLI is running. This URL must use the http schema.
    optional
    IgnoreSslValidationErrors
    SwitchParameter named If specified, any errors with the SSL certificate of the server are ignored.
    optional
    VcsServer
    String named
  • wildcards
  • Specifies 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.

    -AppId  <String>
    -AppSecret  <SecureString>
    -OrganizationId  <String>
    [-IgnoreSslValidationErrors]
    [-VcsServer  <String>]
    [CommonParameters]

    Parameters

    Required Parameter Name Type Position Features Description
    required
    AppId
    String named Specifies the ID of an OAuth App registered in the VMware Cloud Services web portal.
    required
    AppSecret
    SecureString named Specifies the secret of an OAuth App registered in the VMware Cloud Services web portal. You can retrieve the secret from the portal only when you create the application.
    required
    OrganizationId
    String named Specifies the ID of the organization where the access tokens from the security context are valid for. You can see the organization ID in the VMware Cloud Services web portal.
    optional
    IgnoreSslValidationErrors
    SwitchParameter named If specified, any errors with the SSL certificate of the server are ignored.
    optional
    VcsServer
    String named
  • wildcards
  • Specifies 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.

    Output

    VMware.CloudServices.Types.V1.VcsOAuthSecurityContext

    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.

    Example 3

    $oauthCtx = New-VcsOAuthSecurityContext `
    -AppId "VOu3Vhx...d5jYPfS" `
    -AppSecret "zfqytuK...G6mIGL8" `
    -OrganizationId '22b98eec-cdc2-42b8-b770-835e72ecc7c3'

    Creates an OAuth2 security context object by authenticating as a service application using the credentials of a Service-To-Service App registered with the VMware Cloud Services web portal.

    Example 4

    $oauthCtx = New-VcsOAuthSecurityContext `
    -AppId "VOu3Vhx...d5jYPfS" `
    -AppSecret "zfqytuK...G6mIGL8" `
    -OrganizationId '22b98eec-cdc2-42b8-b770-835e72ecc7c3' `
    -RedirectUrl 'http://localhost:8877/powercli'

    Creates an OAuth2 security context object by authenticating through the VMware Cloud Services web portal and providing the credentials of a Web App.

    Related Commands

    Feedback

    Was this page helpful?