Skip to main content
Solved

Print Manager Error: API key is invalid

  • September 9, 2026
  • 3 replies
  • 47 views

ROVECH
Hero (Partner)
Forum|alt.badge.img+8

26R1. Using External Reports Gateway. When testing via External Reports Gateway Settings: Test Connection, an Application Message is created and a REST message is sent to the external service.

However when printing this error message comes up in the Print Manager

I added an additional header in the Routing Address since my external service is only accepting x-api-key<key>, an IFS only sends Authorization: Bearer <key>.

Adding x-api-key=<key> in the additional header section works when testing. Since no application message is created when printing I am unsure this is an issue when printing.

 

Any ideas?

Best answer by Jane Perry

Hi.  I found the followig information -

 

The behavior you are experiencing is due to a fundamental difference in how Test Connection vs. Actual Printing works in IFS Cloud.

Why "Test Connection" Works vs. Why "Printing" Fails

  1. Test Connection (Uses IFS Connect Routing Address):

    • When you perform Test Connection, IFS executes the test through the IFS Connect framework.

    • This generates an Application Message and uses the Routing Address, where your custom x-api-key header is attached and sent to the endpoint.

  2. Actual Printing (Bypasses IFS Connect):

    • During actual printing, the Print Manager / External Reports Gateway rendering engine makes a direct, synchronous HTTP/REST call from the print service/microservice to the external service URL.

    • Actual print rendering does NOT go through IFS Connect Application Messages or Routing Rules.

    • Because it bypasses IFS Connect, any Additional Headers defined on the Connect Routing Address are ignored.

    • Instead, the print engine sends the API Key configured in the External Reports Gateway settings using the hardcoded default header format:
      Authorization: Bearer <key>

    • Since your external service expects x-api-key: <key> and rejects Authorization: Bearer <key>, the external service returns an HTTP 401/403 unauthorized response, which Print Manager logs as API key is invalid.

To resolve this issue, you can use one of the following approaches:

Option 1: Configure an API Gateway / Reverse Proxy (Recommended)

Place an API Gateway or Reverse Proxy (such as Azure API Management, APISIX, or NGINX) between IFS Cloud and your external reporting service:

  • IFS Print Manager sends requests to the API Gateway with Authorization: Bearer <key>.

  • The API Gateway strips Authorization: Bearer and rewrites it to x-api-key: <key> before forwarding the request to your external service.

Option 2: Update the External Service to Accept Authorization: Bearer

Modify your external reporting service endpoint authentication logic to accept Authorization: Bearer <key> in addition to (or instead of) x-api-key.

Option 3: Route Printing via Report Rules & IFS Connect (If Applicable)

If your printing flow allows processing via IFS Connect (e.g., generating PDF output to an outbound channel rather than using direct synchronous rendering):

  • Configure a Report Rule to route the report output through an IFS Connect Outbound Routing Rule linked to your Routing Address.

  • This forces the print output through IFS Connect, ensuring the x-api-key additional header is included.

 

I hope this information helps.  Thanks!  Jane

3 replies

Forum|alt.badge.img+10
  • Hero (Employee)
  • Answer
  • September 9, 2026

Hi.  I found the followig information -

 

The behavior you are experiencing is due to a fundamental difference in how Test Connection vs. Actual Printing works in IFS Cloud.

Why "Test Connection" Works vs. Why "Printing" Fails

  1. Test Connection (Uses IFS Connect Routing Address):

    • When you perform Test Connection, IFS executes the test through the IFS Connect framework.

    • This generates an Application Message and uses the Routing Address, where your custom x-api-key header is attached and sent to the endpoint.

  2. Actual Printing (Bypasses IFS Connect):

    • During actual printing, the Print Manager / External Reports Gateway rendering engine makes a direct, synchronous HTTP/REST call from the print service/microservice to the external service URL.

    • Actual print rendering does NOT go through IFS Connect Application Messages or Routing Rules.

    • Because it bypasses IFS Connect, any Additional Headers defined on the Connect Routing Address are ignored.

    • Instead, the print engine sends the API Key configured in the External Reports Gateway settings using the hardcoded default header format:
      Authorization: Bearer <key>

    • Since your external service expects x-api-key: <key> and rejects Authorization: Bearer <key>, the external service returns an HTTP 401/403 unauthorized response, which Print Manager logs as API key is invalid.

To resolve this issue, you can use one of the following approaches:

Option 1: Configure an API Gateway / Reverse Proxy (Recommended)

Place an API Gateway or Reverse Proxy (such as Azure API Management, APISIX, or NGINX) between IFS Cloud and your external reporting service:

  • IFS Print Manager sends requests to the API Gateway with Authorization: Bearer <key>.

  • The API Gateway strips Authorization: Bearer and rewrites it to x-api-key: <key> before forwarding the request to your external service.

Option 2: Update the External Service to Accept Authorization: Bearer

Modify your external reporting service endpoint authentication logic to accept Authorization: Bearer <key> in addition to (or instead of) x-api-key.

Option 3: Route Printing via Report Rules & IFS Connect (If Applicable)

If your printing flow allows processing via IFS Connect (e.g., generating PDF output to an outbound channel rather than using direct synchronous rendering):

  • Configure a Report Rule to route the report output through an IFS Connect Outbound Routing Rule linked to your Routing Address.

  • This forces the print output through IFS Connect, ensuring the x-api-key additional header is included.

 

I hope this information helps.  Thanks!  Jane


ROVECH
Hero (Partner)
Forum|alt.badge.img+8
  • Author
  • Hero (Partner)
  • September 23, 2026

Hi Jane, thank you for the answer. The design choice to make TEST behave differently than actual printing surprises me, but at least now we know.

 

Also, calling the field "API Key" while transmitting it as Bearer is a documentation and interoperability defect in my opinion. A static secret in the Authorization: Bearer  borrows a scheme whose whole contract — issuer, audience, expiry, scopes — a static key doesn't fulfil. Would you be able to explain to me why this design choice was made and if there is a chance more header authentication flexibility will be available in the future?

Thanks, Roel


Forum|alt.badge.img+10
  • Hero (Employee)
  • September 30, 2026

Hi Roel.  I found some additional information.  This is a long response but I hope it answers your questions -

 

Under RFC 6750 and the OAuth 2.0 specification, the Bearer HTTP authentication scheme is intended for tokens whose semantics imply a full authorization contract—typically issued dynamically by an Authorization Server/IdP with a verifiable lifecycle (iss, aud, exp, sub, and scope).

Placing a static, long-lived preshared secret into Authorization: Bearer conflates static API key authentication with dynamic token-based delegation.

1. Why Systems Make This Design Choice

Despite the conceptual mismatch, engineering teams and enterprise integration clients (such as print managers, background daemons, and sync utilities) frequently adopt Authorization: Bearer <static_secret> due to several pragmatic trade-offs:

  1. API Gateway & Ingress Middleware Homogeneity:

    • Enterprise API gateways (e.g., APISIX, Kong, Envoy, Azure API Management) and security interceptors (Spring Security, ASP.NET, Go middleware) come preconfigured to extract and parse credentials from the standard Authorization: Bearer <...> header.

    • Standardizing on a single header mechanism allows the edge gateway to route all authenticated traffic through unified validation filters—treating both JWTs and opaque static tokens uniformly at the transport layer without maintaining custom parsing rules for headers like X-API-Key or ApiKey <token>.

  2. CORS and HTTP Client Standardization:

    • Authorization is a standard, well-supported header across HTTP libraries, proxy caches, and CORS configurations (Access-Control-Allow-Headers). Custom headers often require explicit allowlisting across microservice mesh boundaries.

  3. Semantic Interpretation of "Bearer":

    • In the broadest RFC definition, a bearer token is simply any credential where possession of the token is sufficient for authorization (without proof-of-possession like mTLS or DPoP). Some implementations lean on this literal definition to justify using Bearer for static secrets, even though it violates the expectation of standard token lifecycle metadata.

  4. UI/UX vs. Implementation Drift:

    • User-facing configuration interfaces often use the label "API Key" because it is familiar to systems administrators and end users (connoting a long-lived configuration secret), while the underlying integration client library simply injects whatever string is provided directly into the Authorization: Bearer template.

2. Why the "API Key is Invalid" Error Typically Happens

When a tool configured with an "API Key" sends a Bearer header and fails with a 401 Unauthorized / API key is invalid error, the root cause is usually one of the following:

  • Backend Expectation Mismatch (JWT vs. Opaque Key): The backend endpoint may have been upgraded or routed to expect a signed JWT from the Identity Provider (e.g., Curity, Entra ID) containing standard claims (aud, iss, tenantId), whereas a static alphanumeric string cannot be parsed as a JWT.

  • Token Prefix Duplication: If the user pastes a value that already includes Bearer , the client might transmit Authorization: Bearer Bearer <key>, causing immediate validation failure.

  • IAM Client / Secret vs. Static Key: In modern service-to-server flows, services increasingly require performing an OAuth client_credentials grant first (exchanging a Client ID and Secret at a /token endpoint) to receive a short-lived access token, rather than sending the raw secret directly on resource calls.

  • Tenant/Scope Binding: The static key might not be mapped to the expected tenant context header (e.g., x-Customer-Id or X-Tenant-Id) or permission role in Central AuthZ.

3. Will Header Authentication Flexibility Improve in the Future?

Industry-wide and across modern enterprise platforms, the trajectory for header authentication is moving in two distinct directions:

  1. Phasing Out Static API Keys in Favor of OAuth 2.0 / OIDC Client Credentials:

    • Rather than adding custom static header schemes (X-API-Key, Authorization: ApiKey), platform architectures are actively migrating background workers and on-premise connectors to standard OAuth 2.0 Client Credentials flows.

    • In this model, the client uses a client ID and secret to fetch short-lived (e.g., 300s) JWT bearer tokens. This restores the proper Authorization: Bearer contract—complete with issuer verification, audience checking, bounded expiry, and tenant-scoped claims.

  2. Gateway-Level Header Mapping:

    • Where static keys remain necessary for lightweight edge integration, modern API gateways support declarative plugin configurations allowing authentication from X-API-Key, custom headers, or query parameters, normalizing them before forwarding downstream.

  3. Sender-Constrained Tokens (Zero Trust):

    • Future platform iterations are moving toward DPoP (Demonstrating Proof-of-Possession) and mTLS to eliminate the inherent security risks of raw bearer credentials altogether.

 

After your review, please advise if you have any other questions.  Thanks!  Jane