Skip to content

register_oidc_config

register_oidc_config(
    network_id: NetworkId,
    company_id: GenericString,
    issuer: GenericString,
    scopes: GenericString,
    *,
    config_overrides: Optional[WickrClientConfig] = None,
    custom_username: Optional[GenericString] = None,
    extra_auth_params: Optional[GenericString] = None,
    secret: Optional[SensitiveString] = None,
    sso_token_buffer_minutes: Optional[int] = None,
    user_id: Optional[GenericString] = None,
) -> RegisterOidcConfigResponse

Registers and saves an OpenID Connect (OIDC) configuration for a Wickr network, enabling Single Sign-On (SSO) authentication through an identity provider.

Parameters:

  • network_id (NetworkId) –

    The ID of the Wickr network for which OIDC will be configured.

  • company_id (GenericString) –

    Custom identifier your end users will use to sign in with SSO.

  • custom_username (Optional[GenericString], default: None ) –

    A custom field mapping to extract the username from the OIDC token (optional).

    The customUsername is only required if you use something other than email as the username field.

  • extra_auth_params (Optional[GenericString], default: None ) –

    Additional authentication parameters to include in the OIDC flow (optional).

  • issuer (GenericString) –

    The issuer URL of the OIDC provider (e.g., 'https://login.example.com').

  • scopes (GenericString) –

    The OAuth scopes to request from the OIDC provider (e.g., 'openid profile email').

  • secret (Optional[SensitiveString], default: None ) –

    The client secret for authenticating with the OIDC provider (optional).

  • sso_token_buffer_minutes (Optional[int], default: None ) –

    The buffer time in minutes before the SSO token expires to refresh it (optional).

  • user_id (Optional[GenericString], default: None ) –

    Unique identifier provided by your identity provider to authenticate the access request. Also referred to as clientID.

Raises:

  • BadRequestError –

    The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.

  • ForbiddenError –

    Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.

  • InternalServerError –

    An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.

  • RateLimitError –

    The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.

  • ResourceNotFoundError –

    The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.

  • UnauthorizedError –

    The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.

  • ValidationError –

    One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Examples:

Save OIDC config successfully

>>> client.register_oidc_config(network_id='12345678', company_id='us-east-1-company123', issuer='https://login.example.com', scopes='openid profile email', user_id='email', sso_token_buffer_minutes=5)
Save OIDC config - missing company ID
>>> client.register_oidc_config(network_id='12345678', company_id='', issuer='https://login.example.com', scopes='openid profile email')
Save OIDC config - invalid company ID prefix
>>> client.register_oidc_config(network_id='12345678', company_id='invalid-company123', issuer='https://login.example.com', scopes='openid profile email')
Source code in docs_src/capo_wickr/_services/wickr.py
def register_oidc_config(
    self,
    network_id: "capo_wickr.types.network_id.NetworkId",
    company_id: "capo_wickr.types.generic_string.GenericString",
    issuer: "capo_wickr.types.generic_string.GenericString",
    scopes: "capo_wickr.types.generic_string.GenericString",
    *,
    config_overrides: Optional[WickrClientConfig] = None,
    custom_username: Optional[
        "capo_wickr.types.generic_string.GenericString"
    ] = None,
    extra_auth_params: Optional[
        "capo_wickr.types.generic_string.GenericString"
    ] = None,
    secret: Optional["capo_wickr.types.sensitive_string.SensitiveString"] = None,
    sso_token_buffer_minutes: Optional[int] = None,
    user_id: Optional["capo_wickr.types.generic_string.GenericString"] = None,
) -> "capo_wickr.types.register_oidc_config_response.RegisterOidcConfigResponse":
    """<p>Registers and saves an OpenID Connect (OIDC) configuration for a Wickr network, enabling Single Sign-On (SSO) authentication through an identity provider.</p>

    Args:
        network_id: <p>The ID of the Wickr network for which OIDC will be configured.</p>
        company_id: <p>Custom identifier your end users will use to sign in with SSO.</p>
        custom_username: <p>A custom field mapping to extract the username from the OIDC token (optional). </p> <note> <p>The customUsername is only required if you use something other than email as the username field.</p> </note>
        extra_auth_params: <p>Additional authentication parameters to include in the OIDC flow (optional).</p>
        issuer: <p>The issuer URL of the OIDC provider (e.g., 'https://login.example.com').</p>
        scopes: <p>The OAuth scopes to request from the OIDC provider (e.g., 'openid profile email').</p>
        secret: <p>The client secret for authenticating with the OIDC provider (optional).</p>
        sso_token_buffer_minutes: <p>The buffer time in minutes before the SSO token expires to refresh it (optional).</p>
        user_id: <p>Unique identifier provided by your identity provider to authenticate the access request. Also referred to as clientID.</p>

    Raises:
        capo_wickr.errors.bad_request_error.BadRequestError: <p>The request was invalid or malformed. This error occurs when the request parameters do not meet the API requirements, such as invalid field values, missing required parameters, or improperly formatted data.</p>
        capo_wickr.errors.forbidden_error.ForbiddenError: <p>Access to the requested resource is forbidden. This error occurs when the authenticated user does not have the necessary permissions to perform the requested operation, even though they are authenticated.</p>
        capo_wickr.errors.internal_server_error.InternalServerError: <p>An unexpected error occurred on the server while processing the request. This indicates a problem with the Wickr service itself rather than with the request. If this error persists, contact Amazon Web Services Support.</p>
        capo_wickr.errors.rate_limit_error.RateLimitError: <p>The request was throttled because too many requests were sent in a short period of time. Wait a moment and retry the request. Consider implementing exponential backoff in your application.</p>
        capo_wickr.errors.resource_not_found_error.ResourceNotFoundError: <p>The requested resource could not be found. This error occurs when you try to access or modify a network, user, bot, security group, or other resource that doesn't exist or has been deleted.</p>
        capo_wickr.errors.unauthorized_error.UnauthorizedError: <p>The request was not authenticated or the authentication credentials were invalid. This error occurs when the request lacks valid authentication credentials or the credentials have expired.</p>
        capo_wickr.errors.validation_error.ValidationError: <p>One or more fields in the request failed validation. This error provides detailed information about which fields were invalid and why, allowing you to correct the request and retry.</p>
        capo_wickr.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Save OIDC config successfully

        >>> client.register_oidc_config(network_id='12345678', company_id='us-east-1-company123', issuer='https://login.example.com', scopes='openid profile email', user_id='email', sso_token_buffer_minutes=5)
        Save OIDC config - missing company ID

        >>> client.register_oidc_config(network_id='12345678', company_id='', issuer='https://login.example.com', scopes='openid profile email')
        Save OIDC config - invalid company ID prefix

        >>> client.register_oidc_config(network_id='12345678', company_id='invalid-company123', issuer='https://login.example.com', scopes='openid profile email')
    """

    def _handler(
        req: "OperationRequest[capo_wickr.types.register_oidc_config_request.RegisterOidcConfigRequest]",
    ) -> OperationResponse[
        "capo_wickr.types.register_oidc_config_response.RegisterOidcConfigResponse"
    ]:
        import capo_wickr._operations.wickr_admin_api.register_oidc_config

        output, http_response = (
            capo_wickr._operations.wickr_admin_api.register_oidc_config.register_oidc_config(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_wickr.types.register_oidc_config_request.RegisterOidcConfigRequest",
    ) -> dict[str, Any]:
        import capo_wickr.types.register_oidc_config_request

        return capo_wickr.types.register_oidc_config_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_wickr.types.register_oidc_config_response.RegisterOidcConfigResponse",
    ) -> dict[str, Any]:
        import capo_wickr.types.register_oidc_config_response

        return capo_wickr.types.register_oidc_config_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "RegisterOidcConfig",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_wickr.types.register_oidc_config_request.RegisterOidcConfigRequest = {
        "network_id": network_id,
        "company_id": company_id,
        "issuer": issuer,
        "scopes": scopes,
    }
    if custom_username is not None:
        input_["custom_username"] = custom_username
    if extra_auth_params is not None:
        input_["extra_auth_params"] = extra_auth_params
    if secret is not None:
        input_["secret"] = secret
    if sso_token_buffer_minutes is not None:
        input_["sso_token_buffer_minutes"] = sso_token_buffer_minutes
    if user_id is not None:
        input_["user_id"] = user_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output