Skip to content

register_client async

register_client(
    client_name: ClientName,
    client_type: ClientType,
    *,
    config_overrides: Optional[AsyncSSOOIDCClientConfig] = None,
    scopes: Optional[Scopes] = None,
    redirect_uris: Optional[RedirectUris] = None,
    grant_types: Optional[GrantTypes] = None,
    issuer_url: Optional[URI] = None,
    entitled_application_arn: Optional[ArnType] = None,
) -> 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.

Parameters:

  • client_name (ClientName) –

    The friendly name of the client.

  • client_type (ClientType) –

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

  • scopes (Optional[Scopes], default: None ) –

    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 (Optional[RedirectUris], default: None ) –

    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 (Optional[GrantTypes], default: None ) –

    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 (Optional[URI], default: None ) –

    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 (Optional[ArnType], default: None ) –

    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.

Raises:

Examples:

Call OAuth/OIDC /register-client endpoint

>>> await client.register_client(client_name='My IDE Plugin', client_type='public', scopes=['sso:account:access', 'codewhisperer:completions'], redirect_uris=['127.0.0.1:PORT/oauth/callback'], grant_types=['authorization_code', 'refresh_token'], issuer_url='https://identitycenter.amazonaws.com/ssoins-1111111111111111', entitled_application_arn='arn:aws:sso::ACCOUNTID:application/ssoins-1111111111111111/apl-1111111111111111')
Source code in docs_src/capo_sso_oidc/_services/async_ssooidc.py
async def register_client(
    self,
    client_name: "capo_sso_oidc.types.client_name.ClientName",
    client_type: "capo_sso_oidc.types.client_type.ClientType",
    *,
    config_overrides: Optional[AsyncSSOOIDCClientConfig] = None,
    scopes: Optional["capo_sso_oidc.types.scopes.Scopes"] = None,
    redirect_uris: Optional[
        "capo_sso_oidc.types.redirect_uris.RedirectUris"
    ] = None,
    grant_types: Optional["capo_sso_oidc.types.grant_types.GrantTypes"] = None,
    issuer_url: Optional["capo_sso_oidc.types.uri.URI"] = None,
    entitled_application_arn: Optional[
        "capo_sso_oidc.types.arn_type.ArnType"
    ] = None,
) -> "capo_sso_oidc.types.register_client_response.RegisterClientResponse":
    """<p>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.</p>

    Args:
        client_name: <p>The friendly name of the client.</p>
        client_type: <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
        scopes: <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
        redirect_uris: <p>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.</p>
        grant_types: <p>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. </p> <p>* Authorization Code - <code>authorization_code</code> </p> <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code> </p> <p>* Refresh Token - <code>refresh_token</code> </p>
        issuer_url: <p>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.</p>
        entitled_application_arn: <p>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.</p>

    Raises:
        capo_sso_oidc.errors.internal_server_exception.InternalServerException: <p>Indicates that an error from the service occurred while trying to process a request.</p>
        capo_sso_oidc.errors.invalid_client_metadata_exception.InvalidClientMetadataException: <p>Indicates that the client information sent in the request during registration is invalid.</p>
        capo_sso_oidc.errors.invalid_redirect_uri_exception.InvalidRedirectUriException: <p>Indicates that one or more redirect URI in the request is not supported for this operation.</p>
        capo_sso_oidc.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter might be missing or out of range.</p>
        capo_sso_oidc.errors.invalid_scope_exception.InvalidScopeException: <p>Indicates that the scope provided in the request is invalid.</p>
        capo_sso_oidc.errors.slow_down_exception.SlowDownException: <p>Indicates that the client is making the request too frequently and is more than the service can handle. </p>
        capo_sso_oidc.errors.unsupported_grant_type_exception.UnsupportedGrantTypeException: <p>Indicates that the grant type in the request is not supported by the service.</p>
        capo_sso_oidc.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Call OAuth/OIDC /register-client endpoint

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

    async def _handler(
        req: "AsyncOperationRequest[capo_sso_oidc.types.register_client_request.RegisterClientRequest]",
    ) -> AsyncOperationResponse[
        "capo_sso_oidc.types.register_client_response.RegisterClientResponse"
    ]:
        import capo_sso_oidc._operations.awsssooidc_service.register_client

        (
            output,
            http_response,
        ) = await capo_sso_oidc._operations.awsssooidc_service.register_client.async_register_client(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_sso_oidc.types.register_client_response.RegisterClientResponse",
    ) -> dict[str, Any]:
        import capo_sso_oidc.types.register_client_response

        return capo_sso_oidc.types.register_client_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("RegisterClient", redact_output=_redact_output),
    )
    input_: capo_sso_oidc.types.register_client_request.RegisterClientRequest = {
        "client_name": client_name,
        "client_type": client_type,
    }
    if scopes is not None:
        input_["scopes"] = scopes
    if redirect_uris is not None:
        input_["redirect_uris"] = redirect_uris
    if grant_types is not None:
        input_["grant_types"] = grant_types
    if issuer_url is not None:
        input_["issuer_url"] = issuer_url
    if entitled_application_arn is not None:
        input_["entitled_application_arn"] = entitled_application_arn

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output