Instructions for

On this page

Set up your Okta org

Identity Engine

This guide covers how to create and set up your Okta org before you can run the Identity Engine sample apps or integrate the SDK or Widget into your own app.


Learning outcomes

Get a new org set up and ready for various use cases.

What you need

Okta Developer Edition organization


Overview of the embedded identity solutions

Okta provides two embedded identity solutions:

  • Embedded SDK only: A highly customizable solution that provides native language support for a variety of identity use cases.
  • Embedded Widget + SDK: A quick and easy to set up solution that moves most of the the heavy lifting to Okta. Although the amount of code that you need to write is small, many of the most advanced identity use cases (for example, social sign-in, multifactor authentication) are supported out of the box.

Displays Okta embedded solution components: (SDK) and (Sign-In Widget + SDK)

This guide shows you how to set up your Okta org to support the embedded SDK or the embedded widget with SDK solutions. Ensure that you get set up with Okta and set up your Okta org for your use case before you

.

Get set up

Sample apps are provided for each solution to show you exactly how to integrate the SDK and the Widget into your own app. Before you can run the sample apps or integrate embedded authentication into your own app, you need to do the following:

  1. Create your Okta account.
  2. Verify that the Interaction Code grant type is enabled.
  3. Update the default Custom Authorization Server.
  4. Create a new application.

After you've created your app, you need to set up your Okta org for your use case scenario.

Create your Okta account

If you don't have an Okta Identity Engine org, you need to sign up for an Okta account and an Identity Engine org.

  1. Sign up (opens new window) for an Okta account.

    After you sign up, Okta sends a verification email to the email address that you provide.

  2. Using the activate link in Okta's email, activate your account and provide a new password. Okta redirects you to the Admin Console of your new Identity Engine org.

Update the default Custom Authorization Server

You need to configure your default Custom Authorization Server to enable the Interaction Code flow.

  1. From your Okta org's Admin Console, select Security > API.

  2. On the Authorization Servers tab, select the pencil icon for the default Custom Authorization Server.

  3. Select the Access Policies tab.

  4. Select the pencil icon from the Actions column for the Default Policy Rule.

  5. In the Edit Rule dialog box, select the Interaction Code checkbox.

    Note: If the Interaction Code checkbox doesn’t appear, the Interaction Code grant type isn’t enabled for your org. To enable it, go to Settings > Account > Embedded widget sign-in support. See Verify that the Interaction Code grant type is enabled. Early Access

  6. Click Update Rule.

Create a new application

Create an app integration that represents the application you want to add authentication to with Okta:

  1. In the Admin Console, go to Applications > Applications.

  2. Click Create App Integration.

  3. Select OIDC - OpenID Connect as the Sign-in method.

    • Enter an application name.

    • Ensure that the Interaction Code checkbox is selected.

      Note: If the Interaction Code checkbox doesn’t appear, the Interaction Code grant type isn’t enabled for your org. To enable it, go to Settings > Account > Embedded widget sign-in support. See Verify that the Interaction Code grant type is enabled. Early Access

    • Select the Refresh Token checkbox.

    • Set Sign-in redirect URIs to

  4. Click Save.

  5. On the General tab, note the Client ID value (and if applicable, the Client secret value) that is used later in your embedded solution.

Note: New apps are automatically assigned the shared default authentication policy with a catch-all rule that allows a user access to the app using either one or two factors, depending on your org setup. To view more information on the default authentication policy, from the left navigation pane, select Security > Authentication Policies and then select Default Policy.

Set up your Okta org for your use case

After you've created your app integration in your Okta org, the next step is to configure your app and org to support the use case that you're implementing.

Set up your Okta org for a password factor only use case

This section shows you how to set up your Okta org and app to support password factor only use cases. These use cases are intended to use the password factor without any additional factors (such as email or phone SMS). In the Create a new application section, you updated that app’s policy to Password only to use Password as the only factor required for a user to sign in. In the next section, follow the steps to finish setting up your Okta org for a password factor only use case.

Update the password authenticator to password only

For password-only authentication, you need to update the password authenticator policy rule to not require any additional verification.

  1. In the Admin Console, go to Security > Authenticators.
  2. Select Edit from the Actions menu on the Password authenticator row.
  3. On the Password policy page, scroll down to the rules section and click the pencil icon next to the Default Rule.
  4. In the Edit Rule dialog box, select Not required in the AND Additional verification is section.
  5. Click Update Rule.

Set up your Okta org for a password-optional use case

For password-optional authentication, you first need to:

  1. Set up the email authenticator for authentication and recovery.
  2. Create a separate group for password-optional users.

To ensure that only specific app integrations can let users sign up without a password, do the following:

  1. Create a profile enrollment policy for password-optional users that adds them to the new group and assign your app to it.
  2. Place this group at the lowest priority (just above the default policy) in the authenticator enrollment policy.

To ensure that only password-optional users can sign in without a password and everybody else is appropriately prompted for it, do the following:

  1. Create a new password-optional authenticator enrollment policy for the group.
  2. Add a new global session policy for the group.
  3. Add a new authentication policy for the group.
  4. Ensure that password-optional users never fall through to the default policy. The default policy should always have a password as a required authenticator.
  5. Explicitly exclude your main admin account from any further password-optional policies you create.

Note: See also Set up password-optional sign-in experience (opens new window).

Common password-optional setup tasks

Set up the email authenticator
  1. Open the Admin Console for your org.
  2. Choose Security > Authenticators to show the available authenticators.
  3. On the Setup tab, locate the Email authenticator, and then select Actions > Edit.
  4. Set This authenticator can be used for to Authentication and recovery.
  5. Click Save.
Create a group for password-optional users
  1. Choose Directory > Groups.
  2. Click Add Group.
  3. Give the group a name. For example, "Password-optional Users".
  4. Click Save.

Enable password-optional user sign-up flow

To ensure that only specific app integrations can let users sign up without a password, do the following:

Create a profile enrollment policy for password-optional users

A profile enrollment policy determines the minimum information required from a user to create an account, and how the user should verify their identity before creating their account.

  1. Choose Security > Profile Enrollment to show the existing enrollment policies.
  2. Click Add Profile Enrollment Policy.
  3. Locate the Profile Enrollment section of the policy and click Edit.
  4. Set Self-service registration to Allowed.
  5. Verify that Required before access is granted is selected for Email Verification.
  6. Set Add the user to group to the group you just made for password-optional users.
  7. Click Save.
  8. Click Manage apps.
  9. Click Add an App to This Policy.
  10. Locate your app integration in the list and click Apply next to it.
  11. Verify that the app is now in the list of Apps using the new Profile Enrollment Policy.

Enable password-optional user sign-in flow

To ensure that only password-optional users can sign in without a password and everybody else is appropriately prompted for it, do the following:

Create a password-optional authenticator enrollment policy

An authenticator enrollment policy determines which authenticators must challenge a user before they are successfully signed in. In this case, email is set to Required, while all the other authenticators are set to Optional.

  1. Choose Security > Authenticators.
  2. Select the Enrollment tab, and then click Add A Policy.
  3. Give the new policy a name. For example, "Password-optional Sign-In Policy".
  4. Set Assign to groups to the group you just made for password-optional users.
  5. In the Eligible Authenticators section:
  • Set Email to Required.
  • Set Password to Optional.
  • Verify that the remaining authenticators are set to Optional.
  1. Click Create Policy.
  2. Give the rule a name. For example, "Password-optional Sign-In Rule".
  3. Set Exclude Users to the names of your main admin accounts.
  4. Leave the other settings at their defaults, and then click Create Rule.
  5. Move the new policy immediately above the Default Policy in the list of policies.
Add a new global session policy for password-optional users

A global session policy determines user session length and basic authentication rules for groups of users. In this case, the policy turns off MFA for all users in the password-optional user group. Therefore, they only need email authentication to sign in.

  1. Choose Security > Global Session Policy.
  2. Click Add policy.
  3. Give the policy a name. For example, "Global Password Optional Policy".
  4. Set Assign to groups to the group you just made for password-optional users.
  5. Click Create Policy and Add Rule.
  6. Give the rule a name. For example, "Global Password Optional Rule".
  7. Verify that Establish the user session with is set to Any factor used to meet the Authentication Policy requirements.
  8. Set Multifactor authentication (MFA) is to Not required.
  9. Leave the other settings at their defaults, and then click Create Rule.
Add a new authentication policy for password-optional users
  1. Choose Security > Authentication Policies.

  2. Click Add a policy.

  3. Give the policy a name, for example "Authenticate with Email Only", and then click Save.

  4. Locate the Catch-all Rule of the new policy and select Actions > Edit.

  5. Set User must authenticate with to Any 1 factor type.

  6. For Possession factor constraints are:

    1. Verify that no options are selected.
    2. Verify that Email is listed in the box under 1 factor type.
  7. Click Save.

  8. Select the Applications tab for your newly created policy, and click Add app.

  9. Find your app in the list and click Add next to it.

  10. Click Close.

  11. Verify that the app is now listed in the Applications tab of the new policy.

Set up your Okta org for a multifactor use case

This section shows you how to set up your Okta org and app to support the multifactor use cases available in this embedded authentication guide. In addition to the password factor, the multifactor use cases presented in this guide use the email and phone factors. Perform the following configuration after you've created a new app to set up the email and phone factors in your Okta org:

  1. Set up the email authenticator for authentication and recovery
  2. Add the phone authenticator for authentication and recovery
  3. Update your authentication policy with multifactor authentication

Note: The multifactor use cases in this guide implement the password, email, and phone factors. However, there are other supported factors that you can use in your embedded authentication app. See Multifactor Authentication (opens new window).

1: Set up the email authenticator for authentication and recovery

  1. In the Admin Console, select Security > Authenticators.
  2. Select Edit from the Actions drop-down menu on the Email authenticator row.
  3. In the Used for section, select Authentication and recovery for the This authenticator can be used for field.
  4. Click Save.

2: Add the phone authenticator for authentication and recovery

Note: If your org already has the phone authenticator added, ensure that the Authentication and recovery option is selected for the This authenticator can be used for field.

  1. To add the phone authenticator, select Security > Authenticators in the Admin Console.

  2. Click Add Authenticator.

  3. On the Add Authenticator page, click Add for the Phone authenticator.

  4. In the Verification options section, select SMS for the User can verify with field.

    Note: Some SDKs support only SMS with a phone authenticator.

  5. In the Used for section, select Authentication and recovery for the This authenticator can be used for field.

  6. Click Add.

3: Update your authentication policy with multifactor authentication

  1. In the Admin Console, go to Security > Authentication Policies.

  2. On the Authentication polices page, select Default Policy as this is the policy that the app that you created is assigned to.

  3. Select Edit from the Actions menu for the Catch-all Rule.

  4. On the Edit Rule dialog, scroll down to the AND User must authenticate with dropdown menu and select Password + Another Factor.

  5. Ensure that no options are selected for the AND Possession factor constraints are field.

  6. Click Save.

    Note: Remember that since the default authentication policy is a shared policy, changes you make are applied to both new and existing apps that are assigned to it.

Set up your Okta org for a social IdP use case

This section shows you how to set up your Okta org and app to support Facebook IdP use cases that are available in this embedded authentication guide. If you want to implement a use case with another social IdP, see Add an external Identity Provider for the list of Okta-supported social IdPs and instructions on how to configure them for social authentication with Okta.

Perform the following configurations after you've created a new app to set up the Facebook IdP and your Okta org:

  1. Create a Facebook app in Facebook
  2. Set up the Facebook test user
  3. (Optional) Switch your Facebook app to Live mode — this step is not required if you want to remain in Facebook Development mode
  4. Create the Facebook Identity Provider in Okta
  5. Add an Identity Provider routing rule in Okta

1: Create a Facebook app in Facebook

  1. Go to Facebook for Developers (opens new window) and click the Login link. If you don't have an account, then create one.
  2. Using these Facebook instructions (opens new window) as a guide, create a Facebook app. When you create the Facebook app, ensure that you select None as the app type.
  3. From the Facebook Apps (opens new window) page, select the app that you just created.
  4. On the App Dashboard page, scroll to the Add a product section.
  5. Click the Set up link in the Facebook Login tile.
  6. On the first set up page, select Web as the platform type.
  7. On the next page, set the value for Site URL to https://${yourOktaDomain}/oauth2/v1/authorize/callback (for example, https://dev-12345678.okta.com/oauth2/v1/authorize/callback).
  8. Click Save and then Continue.
  9. Click through all the Next buttons until you run through all of the sections.
  10. In the left navigation menu, click Facebook Login (under products) and then click Settings.
  11. On the Settings page and under Client OAuth Settings, add the following URLs for the Valid OAuth Redirect URIs field: https://${yourOktaDomain}/oauth2/v1/authorize/callback (for example, https://dev-12345678.okta.com/oauth2/v1/authorize/callback).
  12. Click Save Changes at the bottom of the page.
  13. On the App Dashboard page, expand Settings on the left side of the page, and then click Basic.
  14. Save the App ID and the App Secret values so you can add them to your Okta org's Identity Provider settings.

2: Set up the Facebook test user

A test account is required to test Facebook sign-in in Development mode. Facebook automatically creates one test user for you. Perform the following steps to find, set the password, and save this user's information.

  1. From the Facebook App Dashboard page, click Roles and then click Test Users.
  2. Click Edit for the test user and select Change the name or password for this test user.
  3. In the Edit Test User dialog box, set a password in the New Password and Confirm New Password fields.
  4. Click Save.
  5. Save the test user's email and password for testing social IdP sign-in use cases with Okta and Facebook.

3 (Optional): Switch your Facebook app to Live mode

By default, your Facebook app is in Development mode and can only be used by the test user and the user that you used to sign in and create the Facebook app. As a result, you can only use these users when you test your Facebook sign-in use cases.

If you would like to sign in any public Facebook user, you need to set the Facebook app to Live mode. To switch your Facebook app to Live mode, perform the following steps:

  1. From the Facebook App Dashboard page, click Settings and then click Basic.
  2. Specify a value in the Privacy Policy URL field for your app. If you don't have a privacy URL, you can temporarily use: https://www.okta.com/privacy-policy/.
  3. Click Save Changes at the bottom of the page.
  4. At the top of the App Dashboard page, use the App Mode toggle to switch the app from In development to Live mode.
  5. In the Switch to Live Mode dialog box, click Switch Mode.

4: Create the Facebook Identity Provider in Okta

To connect your org to Facebook, you need to add and configure the Facebook IdP in Okta. The following steps assume that you have already created and configured your Facebook app and that you have the Facebook App ID and App Secret values available.

  1. In the Admin Console, go to Security > Identity Providers.
  2. Click Add Identity Provider and then select Add Facebook.
  3. On the Add Identity Provider - Facebook page, enter a name (for example, Facebook IdP).
  4. Keep the default SSO Only option for the Idp Usage field.
  5. Specify the Facebook App ID value as the Client ID.
  6. Specify the Facebook App Secret value as the Client Secret.
  7. Keep the default values for public_profile and email in the Scopes field.
  8. Click Add Identity Provider.

5: Add an Identity Provider routing rule in Okta

The final step is to add the created Facebook IdP to the routing rule.

  1. In the Admin Console, go to Security > Identity Providers.

  2. On the Identity Providers page, click the Routing Rules tab.

  3. Click Add Routing Rule.

  4. Specify the Rule Name (for example, FB and Okta Rule).

  5. From the THEN Use this identity provider drop-down list, select the Facebook Identity Provider that you've just created. Since Okta is the default IdP, the two values should be:

    • Okta
    • Facebook Identity Provider (IdP)
  6. Click Create Rule.

  7. At the prompt, click Activate.

  8. Your new rule appears above the Default Rule in the routing rule list. This top position signifies that the setting in your new rule overrides the Default Rule.