Skip to main content

Amazon Managed Login

This tutorial shows how to connect Amazon Cognito managed login to a SAML provider such as Microsoft Entra ID, Okta, or Google Workspace.

What You Will Build​

You will configure an Amazon Cognito managed login page, assign it to a Cognito app client, enable your SAML identity provider, and update the FormKiQ CloudFormation stack so users can sign in through SSO.

Before You Begin​

  • A SAML provider already configured for your Amazon Cognito User Pool.
  • Administrative access to the AWS account that hosts the FormKiQ stack.
  • FormKiQ Web URL.

Related identity provider tutorials:

Manage the Okta or Entra App Client with CloudFormation​

Use this workflow when your FormKiQ distribution exposes SamlProviderAllowedCallbackUrl. For Google Workspace or distributions without that parameter, use the manual setup below.

  1. Deploy FormKiQ Web with an empty callback parameter. Once the stack is ready, copy its ConsoleUrl output. Use that exact HTTPS URL whether it points to CloudFront or your custom domain.
  2. Configure the SAML provider in the existing Cognito user pool using the guide for your provider. The standard Cognito provider names are oktaidp for Okta and azureidp for Entra. If your provider has a different name, have FormKiQ configure your distribution to use it before this update. This lets you keep the existing provider and its users. Configure Managed Login on your Cognito domain and assign a style to the existing FormKiQ Web app client.
  3. Update the main FormKiQ stack. Set SamlProvider to Okta or Entra and SamlProviderAllowedCallbackUrl to the URL from step 1. CloudFormation assigns the provider, authorization code grant, and openid, email, and profile scopes to the existing client. In the same update, set CognitoSingleSignOnUrl to the Cognito sign-in URL. For a new setup, use the Cognito authorization endpoint with the main stack's CognitoClientId and URL-encode the callback as redirect_uri.
  4. Sign in to FormKiQ Web through SSO and confirm the user has the expected site access. Keep the SAML selection and callback on subsequent upgrades.

A sign-in URL for a new setup has this form:

https://<cognito-domain>/oauth2/authorize?response_type=code&client_id=<CognitoClientId>&scope=openid+email+profile&redirect_uri=<encoded-ConsoleUrl>

Use the host from the CognitoDomain output. For example, encode https://web.example.com as https%3A%2F%2Fweb.example.com.

For an existing SSO installation, supply the current callback URL and keep the current CognitoSingleSignOnUrl in the first upgrade that introduces the parameter. Before upgrading a client with custom attribute permissions or other customized settings, have FormKiQ include those settings in your distribution. CloudFormation manages the standard client settings above. Provider metadata, attribute mappings, Managed Login branding, and FormKiQ group mapping are configured separately.

If the Web URL changes, obtain the new ConsoleUrl, then update the callback and the redirect URI in the sign-in URL together. Verify sign-in at the new URL before retiring the old one.

Workflow Overview​

  1. Collect FormKiQ Web URL.
  2. Create a Cognito managed login style.
  3. Assign the managed login page to the app client.
  4. Enable the SAML identity provider and OAuth settings.
  5. Update the FormKiQ CloudFormation stack.
  6. Verify the FormKiQ SSO button.

Step 1: Collect FormKiQ Values​

You will need these specific configuration values:

  • FormKiQ Web URL

The CognitoUserPoolId and Console URL can be found in the Outputs tab of your FormKiQ CloudFormation installation.

Cognito User Pool Id and Console Url

Step 2: Configure Cognito Managed Login​

Amazon Cognito Managed login provides a URL connection between Amazon Cognito and SAML provider.

To configure Cognito Managed login, select the Managed login link under the Branding tab on the Cognito console.

Scroll down to the Styles section and click Create a style.

Cognito App Integration

Select the listed App Client and click Create or create a NEW custom app client.

Select Cognito App Client

The Managed login is created. Next, you will need to connect the Managed login to your App Client. Under Assigned app client, click the link to take you to your app client configuration.

Cognito Managed Login Link

The next step is to configure your App client to your Identity provider. On the Login pages tab, click the Edit button.

Cognito App Client Login Page

On the Edit managed login pages configuration page, set the following configuration:

Allowed callback URLs

  • Set the FormKiQ Web Url as an allowed callback. This will allow the user to be redirected to FormKiQ Web after a successful login.

Identity providers

  • Choose Azure or Okta or the identify provider you created

OAuth 2.0 grant types

  • Set the OAuth grant type to Authorization code grant

OpenID Connect scopes

  • Select OpenID, Email, Profile

Once you save the configuration, you'll see the View login page button is now available. This is the link to login to FormKiQ. Make note of the url and you will need to add it to the FormKiQ CloudFormation stack.

Cognito View Login page

Step 3: Update the FormKiQ Stack Configuration​

Once you have the Cognito login page Url, you will need to update your FormKiQ installation to complete the setup.

Visit the CloudFormation console and select to Update your FormKiQ installation stack.

CloudFormation Update Stack

When updating the CloudFormation, you will update the following parameters:

Cognito Single Sign On Url

  • Set the value to be the Cognito login page Url

SAML Provider

  • Select your SAML Provider, ie: Okta / Entra

UserPool Tier

  • Cognito requires you to use either ESSENTIALS or PLUS tier. Select ESSENTIALS unless you know you need PLUS.

CloudFormation Cognito Single Sign On Url

Continue through the stack update process. After it completes, you will see the Single Sign-On login button on FormKiQ Web login page, this link will allow you to login through your SSO provider.

Console Single Cognito Single Sign On

Verify the Result​

Open FormKiQ Web login page and confirm the Single Sign-On button appears. Click it and verify that Cognito redirects to your SAML provider and then back to FormKiQ Web.

Additional Cognito App Client for API Access​

Use CognitoAdditionalClientIds to let one or more additional app clients in the FormKiQ Cognito user pool call the HTTP JWT API. This parameter is available in customer distributions that include the additional app client option.

  1. Collect the IDs of the app clients you want to authorize from the FormKiQ Cognito user pool. For a client created with the customer-specific Install Cognito App Client CloudFormation stack, use the CognitoUserPoolClientId output.
  2. Update the main FormKiQ stack. Set CognitoAdditionalClientIds to the client IDs separated by commas, for example clientId1,clientId2.
  3. After the update completes, open the FormKiQ HTTP API in API Gateway and check the JWT authorizer's Audience list. Verify that it includes the default client ID, the additional client IDs, and the Drive client ID if Drive is enabled. Call the HTTP JWT API with a token from each additional client to confirm access. FormKiQ site permissions still apply.

If you need to create a SAML app client, use the customer-specific Install Cognito App Client link. The user pool must have an Essentials or Plus feature plan and a domain configured for Cognito Managed Login. Configure the identity provider in the pool first. Launch the app-client stack in the same AWS account and Region as FormKiQ, then supply the FormKiQ stack's CognitoUserPoolId, the Cognito provider names in SupportedIdentityProviders, and the application's exact redirect URLs in AllowedCallbackUrls. The stack creates the client and its Managed Login branding.

When upgrading a stack that uses CognitoAdditionalAppClientStackName, copy the CognitoUserPoolClientId output from the app-client stack named in that parameter. Include that ID in CognitoAdditionalClientIds during the upgrade to preserve API access.

To revoke API access for an additional app client, remove its ID from CognitoAdditionalClientIds and update the main stack. Leave the parameter blank to remove all audiences added through this setting. Complete the stack update before deleting any app-client stack.

Clean Up​

Remove test app clients, test styles, or temporary SAML providers that are no longer needed.

Troubleshooting​

ProblemLikely causeWhat to check
SSO button does not appearFormKiQ stack was not updated with the Cognito login URL.Check the Cognito Single Sign On Url CloudFormation parameter.
Login redirects failCallback URL or app client login settings are incomplete.Confirm allowed callback URLs, identity providers, grant type, and scopes.
Cognito says provider is unavailableSAML provider is not assigned to the app client.Edit the app client login page configuration and enable the provider.

Next Steps​

Privacy settings

Analytics is optional. Your analytics choice is shared with formkiq.com and remembered for up to six months. Change it here at any time.

Essential preferences and search

We remember your privacy choice and display preferences. Search runs in your browser using Pagefind files hosted with the docs. It works whether you accept or reject analytics.

Measure page views, installation-link clicks, and selected navigation. This does not enable advertising on the docs. Existing marketing choices for the main website are kept unchanged.

Read the docs privacy notice or manage other main-website privacy choices.