Support
Set up Stack Internal Community for SAML authentication with Okta.

ADMIN PRIVILEGES REQUIRED

Applies to:
Free
Basic
Business
Enterprise

Overview

These instructions describe how to integrate your Stack Internal Community site with Okta as your identity provider for authentication. Once configured, your users will be able to use Okta and the Security Assertion Markup Language (SAML) for Single Sign-on (SSO) authentication into your site. You can learn more about SAML in our SAML Authentication Overview document.

In SSO terminology, Okta is the identity provider (IdP) and your Stack Internal Community site is the service provider (SP). We'll use the terms IdP and SP throughout this article.

Stack Internal Community supports the following features with Okta:

  • IdP-initiated SSO
  • SP-initiated SSO
  • Just-in-time provisioning
  • Force authentication

To configure SSO with Okta, you'll need administrator access to both Okta and Stack Internal Community.

Two configuration methods

There are two ways to configure Okta for SSO authentication for your Stack Internal Community site. We recommend using the Okta app integration method as described below, unless:

  • You can't (or choose not to) access the Okta App Integration Catalog, or
  • You need to add the user's job title and/or department SAML attributes

If either of these applies, skip down to the "ALTERNATE MANUAL CONFIGURATION METHOD" section.

OKTA APP INTEGRATION METHOD

Install the Stack Internal Community SAML application for Okta

  1. In Okta, click Applications, then Browse App Catalog.

  2. Search for "Stack Internal".

  3. On the "General Settings" tab, enter an Application label (we suggest "Stack Internal"). Enter your Stack Internal Community site's full URL in the Okta subdomain field. Click Done.

Assign users to the Okta application

On the Okta "Assignments" tab, assign your users (and/or groups) with the Assign button.

You can't test your SSO configuration until you've assigned users.

This completes the main Okta application configuration. Jump down to the "BOTH METHODS: Configure and test Stack Internal Community SAML settings" section below to finish and test the configuration in Stack Internal Community.

Forced authentication (optional)

You can force your users to sign in with SSO every time they log in by telling Stack Internal Community to ignore previous user authentication sessions. To do this, you'll need to change configuration settings in both Okta and Stack Internal Community.

In the Stack Internal Community Application in Okta:

  1. Go to the "Sign On" tab.
  2. Click Edit Settings.
  3. Uncheck the Disable Force Authentication option.
  1. Go to the Stack Internal Community admin settings "Authentication" menu.
  2. Under "Security settings", check Force reauthentication.

ALTERNATE MANUAL CONFIGURATION METHOD

The following steps allow for manual configuration of Okta SSO. Use this process if you can't (or choose not to) access the Okta App Integration Catalog, or need to add the user job title and department data fields.

Create a new Okta SAML application

  1. In Okta, click Applications, then Create App Integration.

  2. Choose SAML 2.0 as Sign-on method.

  3. On the "General Settings" tab, enter an App name. If desired, upload an App logo.

Configure Okta SAML settings

On the "Configure SAML" tab, configure the following fields:

  • Single sign-on URL Enter your Stack Internal Community SAML URL (https://[your_site].stackenterprise.co/auth/saml2/post).
  • Audience URI (SP Entity ID) Enter any unique value. We suggest using your Stack Internal Community SAML URL (same as above: https://[your_site].stackenterprise.co/auth/saml2/post).
  • Default Relay State Leave blank.
  • Name ID format Select Unspecified.
  • Application username This field identifies the user record, so set this to a user attribute that is unique and will never change (for example: Okta username).

It's important to select an Application username source field that is both unique and unchanging. A user's email address, for example, is unique but not unchanging (an updated email address would result in Stack Internal Community creating a new, duplicated account for that user).

Set attribute statements

Attributes are user information values passed from Okta to Stack Internal Community as part of the login process. You'll need to define at least two SAML attributes: user email and name. This involves giving each attribute a name (which you'll later enter into Stack Internal Community) and choosing which Okta values to attach to each attribute.

Define the SAML attributes Name and Value as follows:

  • email The user's email address. Set Value to user.email.
  • displayName The user's name as it should appear in Stack Internal Community. If you have a custom Okta field with the full user name, set Value to that field. You can also concatenate fields using the ${user.firstName} ${user.lastName} formula.

You can also define optional user job title and department attributes. Populating and sending these attributes on login allows you to use Stack Internal Community's Connectivity feature.

  • jobTitle (optional) The user's job title. Set Value to user.jobtitle.
  • department (optional) The user's department. Set Value to user.department.

A third optional attribute is external ID. You can set this to hold a unique ID for each user (for example: employee number). Stack Internal Community will then display this ID on the user's profile page.

  • externalId (optional) The user's unique ID. Set Value to user.employeeNumber (or any other unique user ID you defined in Okta).

After configuring attributes, click Next.

BOTH METHODS: Configure and test Stack Internal Community SAML settings

You'll continue the configuration by pasting values from Okta into Stack Internal Community. You'll find it easier to have each site in a separate browser tab. You may also want to copy and paste values to a working document.

  1. In Okta, click to select the "Sign On" tab. Under the "Metadata details" heading, click More details.

  2. In a new browser tab, log in to your Stack Internal Community site as an administrator. In the left-hand menu, click Admin settings, then Authentication. Click Use SAML 2.0 (if not already enabled).

  3. On Okta's "Sign On" tab, use the Copy links to add the following values to your Stack Internal Community settings. If you see a setting that's not listed here, leave it unchanged.

    • Assertion consumer service URL Enter the SAML 2.0 post URL of your Stack Internal Community site (https://[your_site].stackenterprise.co/auth/saml2/post).
    • Single sign-on service URL Copy the Sign On URL value from Okta and paste it here.
    • Issuer Copy the Issuer value from Okta and paste it here.
    • Audience restriction Enter the SAML 2.0 post URL of your Stack Internal Community site (same as above: https://[your_site].stackenterprise.co/auth/saml2/post).
    • Use Subject/NameID as the user identifier Enable this checkbox.
    • Fill in the Name value from the Okta "Attribute Statements" tab for each of the following:
      • Display name assertion displayName
      • Email address assertion email
      • Job Title assertion jobTitle (optional)
      • Department assertion department (optional)
      • External ID assertion externalId (optional)
    • Identity provider certificates Scroll down to the "Automation" section to locate the Identity provider certificates field. Back in Okta, click View SAML setup instructions in the bottom right corner of the "Sign On" tab. Copy the entire value shown in the X.509 Certificate field and paste it here.

    Validate your certificate by clicking Validate Certificate. If your certificate passes verification, you'll see a green box with a success message.

To complete the SSO setup, click Save Settings on the Stack Internal Community authentication settings page.

When saving settings, Stack Internal Community will first perform an authentication test. If the test succeeds, Stack Internal Community will apply your new authentication settings. Logged-in users stay logged in, as all active user sessions remain valid.

If the test fails, Stack Internal Community will not apply the authentication settings. You'll stay on the SAML settings page so you can troubleshoot and correct problems. This test acts as a safety net to keep invalid authentication settings from locking users (yourself included) out of your site.

If you have Enable SAML login troubleshooting page on (under the "Troubleshooting" heading below), you can also click Test current configuration. This displays technical details about your SAML authentication. You'll find these helpful for understanding what information your IdP and Stack Internal Community exchange.

SP-initiated SSO

Once you've fully configured your Okta application, the user sign-in process will start with your Stack Internal Community site and proceed as follows:

  1. The user navigates to your Stack Internal Community site (https://[your_site].stackenterprise.co), which initiates the sign-in process.
  2. The Okta sign-in page appears, prompting the user to sign in with their Okta credentials.
  3. If the user credentials are valid, Okta redirects the user to their home page on your Stack Internal Community site.

Other controls

The following controls help you manage SAML sign-in, user profile data, and troubleshooting. Configure only the options that meet your organization's needs. Some of these settings are specialized, and won't apply to most sites. Reach out to support with questions.

Assertions

  • Enable importing profile image on user creation Downloads a profile image when Stack Internal Community creates a user account.
  • Profile image URL assertion Names the SAML attribute that contains a URL for the user's profile image.
  • Profile image Base64 assertion Names the SAML attribute that contains a Base64-encoded profile image. This value takes precedence over the profile image URL when both are available.

Profile updates

  • Allow self-reactivation Reactivates a deactivated account after a successful SAML sign-in. If disabled, an administrator must reactivate the account.
  • Update display name Updates a user's display name from the SAML response after a successful sign-in.
  • Update real name Updates a user's real name from the SAML response after a successful sign-in.
  • Update verified email Updates a user's verified email address from the SAML response after a successful sign-in.

Automation

  • Disable SP-initiated SAML 2.0 SSO Requires users to start sign-in from your identity provider instead of Stack Internal Community.
  • IdP-initiated sign on URL Provides the identity provider URL that users can use when SP-initiated sign-in is disabled.
  • Automatically login Redirects users to your identity provider without showing a sign-in button.
  • Disable NameIDPolicy on SAML requests Prevents Stack Internal Community from including a NameIDPolicy element in SAML requests.
  • Automatic login message Sets the message users see while Stack Internal Community redirects them to your identity provider.
  • Update certificates from federation metadata URL Downloads identity provider signing certificates from an anonymously accessible HTTPS FederationMetadata.xml URL and refreshes them every hour.
  • Identity provider certificates Stores the Base64-encoded public keys that Stack Internal Community uses to verify SAML responses. This section is hidden when you use a federation metadata URL.

Outgoing requests

  • Sign outgoing AuthnRequests Signs authentication requests when your identity provider requires signed requests.
  • Signing certificate Selects the certificate Stack Internal Community uses to sign authentication requests.
  • Digest method Selects the hash algorithm used to sign authentication requests. Use SHA-256 or a stronger option unless your identity provider requires another method.
  • How to attach the public key Selects how Stack Internal Community includes the signing certificate's public-key information in an authentication request.

Security

  • Additional detail on login failure Shows users more information when SAML sign-in fails.
  • Force reauthentication Asks the identity provider to require credentials instead of using an existing sign-in session. Your identity provider might not honor this request.
  • Verify the SubjectConfirmation element Verifies the SubjectConfirmation element in each SAML response. Some identity providers do not provide a valid element.

Troubleshooting

  • Enable SAML login troubleshooting page Makes the SAML troubleshooting page available so you can review the sign-in flow and response details. Enable it only while troubleshooting.
  • Enable SAML Response logging for troubleshooting Logs successful and unsuccessful SAML responses to the database. Enable it only while troubleshooting.
  • Ensure KeyInfo element on EncryptedKey Use this option if encrypted SAML responses fail with an Unable to retrieve the decryption key error.
  • Add UTF-8 byte order mark to the EntityDescriptor.xml Adds a byte order mark to the downloaded EntityDescriptor file for identity providers that require it.

Use these links to test your configuration, manage access, and exchange SAML metadata with your identity provider.

  • Test current configuration Starts a full login test with your saved SAML settings. You'll only see this link if Enable SAML login troubleshooting page is on.
  • Set up access rules Configures rules that determine which users can access your site after a successful SAML sign-in.
  • Download EntityDescriptor Downloads the SAML metadata file that you can import into your identity provider.
  • Parse EntityDescriptor Tests and displays the SAML metadata file from your identity provider.

Get help

Properly configuring SAML authentication can be tricky. For more information on troubleshooting, see the SAML Authentication Troubleshooting article. You can also reach out to Stack Overflow support for help.

https://doc-automation.netlify.app/pdfs/docs/community/enterprise/for_admins/single_sign-on_sso/configure_SAML_SSO_okta.pdf

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article