# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).

import oci

# Create a default config using DEFAULT profile in default location
# Refer to
# https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File
# for more info
config = oci.config.from_file()


# Initialize service client with default config file
identity_domains_client = oci.identity_domains.IdentityDomainsClient(
    config, "https://endpoint_of_this_service.com")


# Send the request to service, some parameters are not required, see API
# doc for more info
put_authentication_factor_setting_response = identity_domains_client.put_authentication_factor_setting(
    authentication_factor_setting_id="ocid1.test.oc1..<unique_ID>EXAMPLE-authenticationFactorSettingId-Value",
    authorization="EXAMPLE-authorization-Value",
    resource_type_schema_version="EXAMPLE-resourceTypeSchemaVersion-Value",
    attributes="EXAMPLE-attributes-Value",
    attribute_sets=["request"],
    authentication_factor_setting=oci.identity_domains.models.AuthenticationFactorSetting(
        schemas=["EXAMPLE--Value"],
        sms_enabled=False,
        totp_enabled=True,
        push_enabled=True,
        bypass_code_enabled=True,
        security_questions_enabled=True,
        mfa_enrollment_type="EXAMPLE-mfaEnrollmentType-Value",
        notification_settings=oci.identity_domains.models.AuthenticationFactorSettingsNotificationSettings(
            pull_enabled=True),
        bypass_code_settings=oci.identity_domains.models.AuthenticationFactorSettingsBypassCodeSettings(
            self_service_generation_enabled=False,
            help_desk_generation_enabled=True,
            length=27,
            max_active=265,
            help_desk_code_expiry_in_mins=64,
            help_desk_max_usage=621),
        client_app_settings=oci.identity_domains.models.AuthenticationFactorSettingsClientAppSettings(
            min_pin_length=660,
            max_failures_before_warning=560,
            max_failures_before_lockout=160,
            initial_lockout_period_in_secs=985,
            lockout_escalation_pattern="EXAMPLE-lockoutEscalationPattern-Value",
            max_lockout_interval_in_secs=484,
            request_signing_algo="SHA384withRSA",
            policy_update_freq_in_days=841,
            key_pair_length=984,
            device_protection_policy="EXAMPLE-deviceProtectionPolicy-Value",
            unlock_app_for_each_request_enabled=False,
            unlock_on_app_start_enabled=True,
            unlock_app_interval_in_secs=918,
            shared_secret_encoding="Base32",
            unlock_on_app_foreground_enabled=False),
        endpoint_restrictions=oci.identity_domains.models.AuthenticationFactorSettingsEndpointRestrictions(
            max_enrolled_devices=167,
            max_trusted_endpoints=917,
            max_endpoint_trust_duration_in_days=872,
            trusted_endpoints_enabled=False,
            max_incorrect_attempts=54),
        compliance_policy=[
            oci.identity_domains.models.AuthenticationFactorSettingsCompliancePolicy(
                name="EXAMPLE-name-Value",
                action="Block",
                value="EXAMPLE-value-Value")],
        totp_settings=oci.identity_domains.models.AuthenticationFactorSettingsTotpSettings(
            hashing_algorithm="SHA384",
            passcode_length=216,
            key_refresh_interval_in_days=108,
            time_step_in_secs=894,
            time_step_tolerance=106,
            sms_otp_validity_duration_in_mins=727,
            jwt_validity_duration_in_secs=245,
            sms_passcode_length=513,
            email_otp_validity_duration_in_mins=596,
            email_passcode_length=527),
        id="ocid1.test.oc1..<unique_ID>EXAMPLE-id-Value",
        ocid="EXAMPLE-ocid-Value",
        meta=oci.identity_domains.models.Meta(
            resource_type="EXAMPLE-resourceType-Value",
            created="EXAMPLE-created-Value",
            last_modified="EXAMPLE-lastModified-Value",
            location="EXAMPLE-location-Value",
            version="EXAMPLE-version-Value"),
        idcs_created_by=oci.identity_domains.models.IdcsCreatedBy(
            value="EXAMPLE-value-Value",
            ref=None,
            type="User",
            display="EXAMPLE-display-Value",
            ocid="EXAMPLE-ocid-Value"),
        idcs_last_modified_by=oci.identity_domains.models.IdcsLastModifiedBy(
            value="EXAMPLE-value-Value",
            ref=None,
            type="User",
            display="EXAMPLE-display-Value",
            ocid="EXAMPLE-ocid-Value"),
        idcs_prevented_operations=["replace"],
        tags=[
            oci.identity_domains.models.Tags(
                key="EXAMPLE-key-Value",
                value="EXAMPLE-value-Value")],
        delete_in_progress=False,
        idcs_last_upgraded_in_release="EXAMPLE-idcsLastUpgradedInRelease-Value",
        domain_ocid="EXAMPLE-domainOcid-Value",
        compartment_ocid="EXAMPLE-compartmentOcid-Value",
        tenancy_ocid="EXAMPLE-tenancyOcid-Value",
        email_enabled=True,
        phone_call_enabled=False,
        fido_authenticator_enabled=False,
        yubico_otp_enabled=True,
        mfa_enabled_category="EXAMPLE-mfaEnabledCategory-Value",
        hide_backup_factor_enabled=False,
        auto_enroll_email_factor_disabled=True,
        user_enrollment_disabled_factors=["FIDO_AUTHENTICATOR"],
        email_settings=oci.identity_domains.models.AuthenticationFactorSettingsEmailSettings(
            email_link_enabled=True,
            email_link_custom_url="EXAMPLE-emailLinkCustomUrl-Value"),
        third_party_factor=oci.identity_domains.models.AuthenticationFactorSettingsThirdPartyFactor(
            duo_security=True),
        identity_store_settings=oci.identity_domains.models.AuthenticationFactorSettingsIdentityStoreSettings(
            mobile_number_enabled=True,
            mobile_number_update_enabled=True),
        urn_ietf_params_scim_schemas_oracle_idcs_extension_third_party_authentication_factor_settings=oci.identity_domains.models.ExtensionThirdPartyAuthenticationFactorSettings(
            duo_security_settings=oci.identity_domains.models.AuthenticationFactorSettingsDuoSecuritySettings(
                integration_key="EXAMPLE-integrationKey-Value",
                secret_key="EXAMPLE-secretKey-Value",
                api_hostname="EXAMPLE-apiHostname-Value",
                user_mapping_attribute="givenName",
                attestation_key="EXAMPLE-attestationKey-Value")),
        urn_ietf_params_scim_schemas_oracle_idcs_extension_fido_authentication_factor_settings=oci.identity_domains.models.ExtensionFidoAuthenticationFactorSettings(
            attestation="NONE",
            authenticator_selection_attachment="CROSS-PLATFORM",
            authenticator_selection_user_verification="DISCOURAGED",
            authenticator_selection_resident_key="PREFERRED",
            timeout=458,
            authenticator_selection_require_resident_key=True,
            public_key_types=["RS1"],
            exclude_credentials=True,
            domain_validation_level=299)),
    if_match="EXAMPLE-ifMatch-Value",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(put_authentication_factor_setting_response.data)

Was this article helpful?