OctaSapien

Diagnose HTTP 401 in an SAP CPI iFlow

Find which system returned HTTP 401 in SAP CPI. Check inbound and outbound authentication settings and logs before retrying.

  1. Find the request that returned HTTP 401

    Start with the caller’s response and the Message Processing Log (MPL) for the iFlow, when available. In the sample, the status code shows the error. The receiver step and URL identify the request that failed.

    Synthetic MPL excerpt from the HTTP receiver step
    CamelHttpResponseCode=401
    Endpoint=https://api.example.test/demo/orders
  2. Check authentication on the side that returned HTTP 401

    Inbound request to the sender endpoint

    Correlate the caller’s logs with the tenant’s HTTP access logs, where available. A missing MPL entry alone does not show where the request was rejected. Compare the caller’s authentication method with the deployed sender endpoint settings.

    Outbound call to the receiver

    Find the failing URL in the MPL or exception details, when available. With OAuth, check whether the URL belongs to the target API or to the token service. The token service can return 401 before the API call is sent. Check the corresponding system’s authentication log at the time of the failure. Verify the deployed adapter’s authentication settings and any credential or certificate alias it uses.

    SAP KBA 3336843 (OAuth token service)
  3. Confirm the cause before retrying

    The CPI Error Analyzer flags the example as an authentication error and advises against retrying. Confirm and correct the cause on the system that rejected the request before you try again.

Open OS, the OctaSapien assistant