There are more AWS SDK examples available in the AWS Doc SDK Examples
Use AddClientIdToOpenIdConnectProvider with a CLI
The following code examples show how to use AddClientIdToOpenIdConnectProvider.
- CLI
-
- AWS CLI
-
To add a client ID (audience) to an Open-ID Connect (OIDC) provider
The following
add-client-id-to-open-id-connect-providercommand adds the client IDmy-application-IDto the OIDC provider namedserver.example.com.aws iam add-client-id-to-open-id-connect-provider \ --client-idmy-application-ID\ --open-id-connect-provider-arnarn:aws:iam::123456789012:oidc-provider/server.example.comThis command produces no output.
To create an OIDC provider, use the
create-open-id-connect-providercommand.For more information, see Creating OpenID Connect (OIDC) identity providers in the AWS IAM User Guide.
-
For API details, see AddClientIdToOpenIdConnectProvider
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This command adds the client ID (or audience)
my-application-IDto the existing OIDC provider namedserver.example.com.Add-IAMClientIDToOpenIDConnectProvider -ClientID "my-application-ID" -OpenIDConnectProviderARN "arn:aws:iam::123456789012:oidc-provider/server.example.com"-
For API details, see AddClientIdToOpenIdConnectProvider in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This command adds the client ID (or audience)
my-application-IDto the existing OIDC provider namedserver.example.com.Add-IAMClientIDToOpenIDConnectProvider -ClientID "my-application-ID" -OpenIDConnectProviderARN "arn:aws:iam::123456789012:oidc-provider/server.example.com"-
For API details, see AddClientIdToOpenIdConnectProvider in AWS Tools for PowerShell Cmdlet Reference (V5).
-