Skip to content

create_identity_provider async

create_identity_provider(
    portal_arn: ARN,
    identity_provider_name: IdentityProviderName,
    identity_provider_type: IdentityProviderType,
    identity_provider_details: IdentityProviderDetails,
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    tags: Optional[TagList] = None,
) -> CreateIdentityProviderResponse

Creates an identity provider resource that is then associated with a web portal.

Parameters:

  • portal_arn (ARN) –

    The ARN of the web portal.

  • identity_provider_name (IdentityProviderName) –

    The identity provider name.

  • identity_provider_type (IdentityProviderType) –

    The identity provider type.

  • identity_provider_details (IdentityProviderDetails) –

    The identity provider details. The following list describes the provider detail keys for each identity provider type.

    • For Google and Login with Amazon:

      • client_id

      • client_secret

      • authorize_scopes

    • For Facebook:

      • client_id

      • client_secret

      • authorize_scopes

      • api_version

    • For Sign in with Apple:

      • client_id

      • team_id

      • key_id

      • private_key

      • authorize_scopes

    • For OIDC providers:

      • client_id

      • client_secret

      • attributes_request_method

      • oidc_issuer

      • authorize_scopes

      • authorize_url if not available from discovery URL specified by oidc_issuer key

      • token_url if not available from discovery URL specified by oidc_issuer key

      • attributes_url if not available from discovery URL specified by oidc_issuer key

      • jwks_uri if not available from discovery URL specified by oidc_issuer key

    • For SAML providers:

      • MetadataFile OR MetadataURL

      • IDPSignout (boolean) optional

      • IDPInit (boolean) optional

      • RequestSigningAlgorithm (string) optional - Only accepts rsa-sha256

      • EncryptedResponses (boolean) optional

  • client_token (Optional[ClientToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.

    If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.

  • tags (Optional[TagList], default: None ) –

    The tags to add to the identity provider resource. A tag is a key-value pair.

Raises:

Source code in docs_src/capo_workspaces_web/_services/async_work_spaces_web.py
async def create_identity_provider(
    self,
    portal_arn: "capo_workspaces_web.types.arn.ARN",
    identity_provider_name: "capo_workspaces_web.types.identity_provider_name.IdentityProviderName",
    identity_provider_type: "capo_workspaces_web.types.identity_provider_type.IdentityProviderType",
    identity_provider_details: "capo_workspaces_web.types.identity_provider_details.IdentityProviderDetails",
    *,
    config_overrides: Optional[AsyncWorkSpacesWebClientConfig] = None,
    client_token: Optional[
        "capo_workspaces_web.types.client_token.ClientToken"
    ] = None,
    tags: Optional["capo_workspaces_web.types.tag_list.TagList"] = None,
) -> "capo_workspaces_web.types.create_identity_provider_response.CreateIdentityProviderResponse":
    """<p>Creates an identity provider resource that is then associated with a web portal.</p>

    Args:
        portal_arn: <p>The ARN of the web portal.</p>
        identity_provider_name: <p>The identity provider name.</p>
        identity_provider_type: <p>The identity provider type.</p>
        identity_provider_details: <p>The identity provider details. The following list describes the provider detail keys for each identity provider type. </p> <ul> <li> <p>For Google and Login with Amazon:</p> <ul> <li> <p> <code>client_id</code> </p> </li> <li> <p> <code>client_secret</code> </p> </li> <li> <p> <code>authorize_scopes</code> </p> </li> </ul> </li> <li> <p>For Facebook:</p> <ul> <li> <p> <code>client_id</code> </p> </li> <li> <p> <code>client_secret</code> </p> </li> <li> <p> <code>authorize_scopes</code> </p> </li> <li> <p> <code>api_version</code> </p> </li> </ul> </li> <li> <p>For Sign in with Apple:</p> <ul> <li> <p> <code>client_id</code> </p> </li> <li> <p> <code>team_id</code> </p> </li> <li> <p> <code>key_id</code> </p> </li> <li> <p> <code>private_key</code> </p> </li> <li> <p> <code>authorize_scopes</code> </p> </li> </ul> </li> <li> <p>For OIDC providers:</p> <ul> <li> <p> <code>client_id</code> </p> </li> <li> <p> <code>client_secret</code> </p> </li> <li> <p> <code>attributes_request_method</code> </p> </li> <li> <p> <code>oidc_issuer</code> </p> </li> <li> <p> <code>authorize_scopes</code> </p> </li> <li> <p> <code>authorize_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i> </p> </li> <li> <p> <code>token_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i> </p> </li> <li> <p> <code>attributes_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i> </p> </li> <li> <p> <code>jwks_uri</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i> </p> </li> </ul> </li> <li> <p>For SAML providers:</p> <ul> <li> <p> <code>MetadataFile</code> OR <code>MetadataURL</code> </p> </li> <li> <p> <code>IDPSignout</code> (boolean) <i>optional</i> </p> </li> <li> <p> <code>IDPInit</code> (boolean) <i>optional</i> </p> </li> <li> <p> <code>RequestSigningAlgorithm</code> (string) <i>optional</i> - Only accepts <code>rsa-sha256</code> </p> </li> <li> <p> <code>EncryptedResponses</code> (boolean) <i>optional</i> </p> </li> </ul> </li> </ul>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p> <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
        tags: <p>The tags to add to the identity provider resource. A tag is a key-value pair.</p>

    Raises:
        capo_workspaces_web.errors.access_denied_exception.AccessDeniedException: <p>Access is denied.</p>
        capo_workspaces_web.errors.conflict_exception.ConflictException: <p>There is a conflict.</p>
        capo_workspaces_web.errors.internal_server_exception.InternalServerException: <p>There is an internal server error.</p>
        capo_workspaces_web.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource cannot be found.</p>
        capo_workspaces_web.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_workspaces_web.errors.throttling_exception.ThrottlingException: <p>There is a throttling error.</p>
        capo_workspaces_web.errors.validation_exception.ValidationException: <p>There is a validation error.</p>
        capo_workspaces_web.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_workspaces_web.types.create_identity_provider_request.CreateIdentityProviderRequest]",
    ) -> AsyncOperationResponse[
        "capo_workspaces_web.types.create_identity_provider_response.CreateIdentityProviderResponse"
    ]:
        import capo_workspaces_web._operations.aws_ermine_control_plane_service.create_identity_provider

        (
            output,
            http_response,
        ) = await capo_workspaces_web._operations.aws_ermine_control_plane_service.create_identity_provider.async_create_identity_provider(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_workspaces_web.types.create_identity_provider_request.CreateIdentityProviderRequest",
    ) -> dict[str, Any]:
        import capo_workspaces_web.types.create_identity_provider_request

        return capo_workspaces_web.types.create_identity_provider_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateIdentityProvider", redact_input=_redact_input),
    )
    input_: capo_workspaces_web.types.create_identity_provider_request.CreateIdentityProviderRequest = {
        "portal_arn": portal_arn,
        "identity_provider_name": identity_provider_name,
        "identity_provider_type": identity_provider_type,
        "identity_provider_details": identity_provider_details,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if tags is not None:
        input_["tags"] = tags

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