Use AddClientIdToOpenIdConnectProvider with an Amazon SDK or command line tool - Amazon Identity and Access Management
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use AddClientIdToOpenIdConnectProvider with an Amazon SDK or command line tool

The following code examples show how to use AddClientIdToOpenIdConnectProvider.

CLI
Amazon CLI

To add a client ID (audience) to an Open-ID Connect (OIDC) provider

The following add-client-id-to-open-id-connect-provider command adds the client ID my-application-ID to the OIDC provider named server.example.com.

aws iam add-client-id-to-open-id-connect-provider \ --client-id my-application-ID \ --open-id-connect-provider-arn arn:aws:iam::123456789012:oidc-provider/server.example.com

This command produces no output.

To create an OIDC provider, use the create-open-id-connect-provider command.

For more information, see Creating OpenID Connect (OIDC) identity providers in the Amazon IAM User Guide.

PowerShell
Tools for PowerShell

Example 1: This command adds the client ID (or audience) my-application-ID to the existing OIDC provider named server.example.com.

Add-IAMClientIDToOpenIDConnectProvider -ClientID "my-application-ID" -OpenIDConnectProviderARN "arn:aws:iam::123456789012:oidc-provider/server.example.com"

For a complete list of Amazon SDK developer guides and code examples, see Using IAM with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.