Method: Aws::SSOOIDC::Client#register_client

Defined in:
lib/aws-sdk-ssooidc/client.rb

#register_client(params = {}) ⇒ Types::RegisterClientResponse

Registers a public client with IAM Identity Center. This allows clients to perform authorization using the authorization code grant with Proof Key for Code Exchange (PKCE) or the device code grant.

Examples:

Example: Call OAuth/OIDC /register-client endpoint


resp = client.register_client({
  client_name: "My IDE Plugin", 
  client_type: "public", 
  entitled_application_arn: "arn:aws:sso::ACCOUNTID:application/ssoins-1111111111111111/apl-1111111111111111", 
  grant_types: [
    "authorization_code", 
    "refresh_token", 
  ], 
  issuer_url: "https://identitycenter.amazonaws.com/ssoins-1111111111111111", 
  redirect_uris: [
    "127.0.0.1:PORT/oauth/callback", 
  ], 
  scopes: [
    "sso:account:access", 
    "codewhisperer:completions", 
  ], 
})

resp.to_h outputs the following:
{
  client_id: "_yzkThXVzLWVhc3QtMQEXAMPLECLIENTID", 
  client_id_issued_at: 1579725929, 
  client_secret: "VERYLONGSECRETeyJraWQiOiJrZXktMTU2NDAyODA5OSIsImFsZyI6IkhTMzg0In0", 
  client_secret_expires_at: 1587584729, 
}

Request syntax with placeholder values


resp = client.register_client({
  client_name: "ClientName", # required
  client_type: "ClientType", # required
  scopes: ["Scope"],
  redirect_uris: ["URI"],
  grant_types: ["GrantType"],
  issuer_url: "URI",
  entitled_application_arn: "ArnType",
})

Response structure


resp.client_id #=> String
resp.client_secret #=> String
resp.client_id_issued_at #=> Integer
resp.client_secret_expires_at #=> Integer
resp.authorization_endpoint #=> String
resp.token_endpoint #=> String

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :client_name (required, String)

    The friendly name of the client.

  • :client_type (required, String)

    The type of client. The service supports only ‘public` as a client type. Anything other than public will be rejected by the service.

  • :scopes (Array<String>)

    The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.

  • :redirect_uris (Array<String>)

    The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.

  • :grant_types (Array<String>)

    The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.

    • Authorization Code - ‘authorization_code`

    • Device Code - ‘urn:ietf:params:oauth:grant-type:device_code`

    • Refresh Token - ‘refresh_token`

  • :issuer_url (String)

    The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.

  • :entitled_application_arn (String)

    This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.

Returns:

See Also:



973
974
975
976
# File 'lib/aws-sdk-ssooidc/client.rb', line 973

def register_client(params = {}, options = {})
  req = build_request(:register_client, params)
  req.send_request(options)
end