<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Error "Failed to authenticate request. Please check your headers" When Trying to Invoke API Endpoint Secured with OAuth 2.0
Workflows
Okta Classic Engine
Okta Identity Engine
Overview

This article will address getting a 401 Error Failed to authenticate request. Please check your headers when attempting to Invoke a flow with an API endpoint using OAuth 2.0, either through a third party or via testing via Postman or Workflows, as shown in Invoke and Test an OAuth 2.0 Secured API Endpoint

Applies To
Cause

This can occur when a single Custom Domain is used for authentication with the Okta Org that is tied to Workflowsand the audience value set when setting up the JWT, as well as the token endpoint used to request a token, are configured to use the default domain. If the Okta Org uses a single Custom Domain, Workflows expects auth to occur via that domain.

NOTE: If there is no Custom Domain or more than one Custom Domain (Workflows would not know which to associate with), the default Okta domain would be used. See Workflows Console Required to Authenticate Custom Domain for more information on the Custom Domain behavior.

Solution

Use the following steps to update the audience value and the token endpoint to use the Custom Domain instead of the default Okta domain.

  1. Verify:

    1. audience value configured for the JWT.
    2. The token endpoint/url used to request a token.
  2. Update both values to use the custom domain instead of the default Okta domain (for example, use <login.example.com> instead of <orgname.okta.com>).

 

Related References

Loading
Error "Failed to authenticate request. Please check your headers" When Trying to Invoke API Endpoint Secured with OAuth 2.0