VIO Category
Cmdlets are usually implemented around resource operations. The four basic operations are CREATE, READ, UPDATE and DELETE. This set of operations is known as CRUD. Most of the cmdlets support CRUD which are respectively cmdlets that start with the New/Get/Set/Remove cmdlet verbs but they also may have additional operations
Step 1: Retrieve a object by running a Get command
# Retrieves all OAuth2 clients with names that start with "MyOAuth2Client".
Get-VIOauth2Client -Name "MyOAuth2Client*"
Step 2 : Run commands from the CRUD group
# Creates a registration for a public OAuth 2.0 client with the specified client ID, scopes, grant types, and redirect URL. The OAuth2 client must implement the Proof Key for Code Exchange (PKCE) protocol to be registered.
PS C:\> New-VIOAuth2Client ` -ClientId "my-public-oauth-client" ` -Name "My Public OAuth2 Client" ` -Scope @("openid", "profile", "user", "group") ` -GrantTypes @("authorization_code", "refresh_token", "password") ` -RedirectUris @("http://127.0.0.1:8877/authcode") ` -RefreshTokenTimeToLiveMinutes 43200 ` -RefreshTokenIdleTimeToLiveMinutes 43200 ` -PkceEnforced $true ` -PublicClient $true
# Forces an immediate secret rotation for an OAuth 2 client with client ID "my-client-id".
PS C:\> Get-VIOAuth2Client -Id "my-client-id" | Complete-VIOAuth2ClientSecretRotation
# Deletes the registration with ID "my-ouath2-client".
PS C:\> Get-VIOAuth2Client -Id "my-ouath2-client" | Remove-VIOAuth2Client
Step 3: Explore More Related Commands:
Get-VIObjectByVIView | This cmdlet converts a vSphere View object to a VIObject. |
Set-VIOAuth2Client | Updates the configuration of the OAuth2 client registered with the VMware Identity Broker. |
Start-VIOAuth2ClientSecretRotation | Initiates a rotation of the secret of an OAuth 2 client. |