Setting up OIDC back-channel single-logout using the IBM Verify OIDC OP

In my environment I set this up using podman on a CentOS VM, but any container platform can be used. This setup was tested with the following IBM components:

In my case the Relying Party is a containerized ISVG-IM environment, but any application will suffice, that supports the base OIDC standard. (The OIDC configuration of ISVG-IM used in this guide is available here.)

The logout endpoint on the RP side is mocked using httpbin. Its /anything endpoint always returns HTTP 200 with the received payload echoed back, making it ideal for this scenario.

Prerequisites and assumptions

This guide assumes that the following components are already in place, configured and working. The scope of this guide is only the additional configuration needed to get OIDC back-channel SLO working.

Configuration steps

Reverse Proxy configuration changes

The following changes must be made in the reverse proxy’s configuration file, that sits in front of the OIDC OP:

[eai]
eai-auth = https

[eai-trigger-urls]
# The OIDC OP will terminate the WebSEAL session using EAI Headers, this is needed for them to get detected
trigger = /isvaop/oauth2/logout*
trigger = /isvaop/oauth2/rplogout*

[jwt:/isvaop]
...
claim = attr::AZN_CRED_PRINCIPAL_NAME::sub
claim = attr::AZN_CRED_PRINCIPAL_NAME::name
claim = attr::AZN_CRED_PRINCIPAL_NAME::uid
claim = attr::isTwoFactorPolicy::isTwoFactorPolicy
claim = attr::AUTH*
claim = attr::AZN_*
claim = attr::x-client-certificate
# Pass the WebSEAL session index to the provider, this can be used to terminate the WebSEAL session upon logout
claim = attr::tagvalue_session_index::tagvalue_session_index
...

Define OIDC Client with back-channel logout

Define a client with the back-channel logout configuration. Substitute client_id, client_secret, client_name and redirect_uris as appropriate for your environment. The configuration of back-channel logout can be found under single_logout_settings. Substitute logout_endpoint and post_logout_redirect_uris as appropriate.

In a real life deployment reference the client_secret from some form of a secret, don’t put it in plain text into the configuration. In this case this was done for clarity.

Configuration reference here: https://docs.verify.ibm.com/ibm-security-verify-access/docs/yaml_clients-client

clients:
  - client_id: "isim"
    client_secret: "isimsecret"
    client_name: "isim"
    enabled: true
    redirect_uris:
      - https://isim.mmfa.ibm.com:30943/oidcclient/redirect/isc
      - https://isim.mmfa.ibm.com:30943/oidcclient/redirect/rest
      - https://isim.mmfa.ibm.com:30943/oidcclient/redirect/adminConsole
    grant_types:
      - authorization_code
    response_types:
      - code
      - code token
    token_endpoint_auth_method: client_secret_post
    require_pkce: false
    single_logout_settings:
      logout_option: "back_channel"
      # The endpoint to be called to initiate the logout for an application, a logout_token will be sent to this endpoint for in the case of a back_channel logout
      logout_endpoint: "http://httpbin.mmfa.ibm.com/anything"
      # This list indicates the allowed list of URL's which the browser can redirect to, once the logout is completed.
      post_logout_redirect_uris: 
        - "http://myhost/postlogout"
      require_session_id: true

The logout flow

The logout flow is described in detail here: https://docs.verify.ibm.com/ibm-security-verify-access/docs/tasks-logout#single-logout-flow

One important note to these steps, the logout endpoint (/isvaop/oauth2/rplogout) MUST be called from a valid WebSEAL session, meaning the session cookie has to be sent with the request.

The logout endpoint in the RP

The logout endpoint should expect a POST with a logout token (described below), validate it and terminate the appropriate session. It should respond with an HTTP 200 (or 204) in case of success, otherwise with an error code and optional JSON body. E.g.:

HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store

{
  "error": "invalid_request",
  "error_description": "The logout_token is invalid"
}

The tokens

There are a few differences to the tokens when back-channel logout is in use. The following tokens are issued during the authorization code flow.

Access Token:

{
  "aud": [
    "isim"
  ],
  "client_id": "isim",
  "exp": 1763727262,
  "grant_id": "08f565d1-26e7-4228-aabf-ada4a2bf063e",
  "groups": [
    "TestGroup1",
    "TestGroup2",
    "TestGroup3"
  ],
  "iat": 1763724261,
  "iss": "https://www.iamlab.ibm.com",
  "jti": "0edd8108-d8dd-47f5-9639-3dfe27597de2",
  "nbf": 1763724261,
  "scope": "openid",
  "session_index": "a07356e2-c6cc-11f0-b81d-1f9365dfdc3b",
  "sub": "container_testuser"
}

The Access Token now contains a session_index claim with the value of the tagvalue_session_index session attribute passed by WebSEAL. This will be used to terminate the session.

ID Token:

{
  "acr": "urn:ibm:basic",
  "at_hash": "NaKHy5Zz7HnAiP_LYY0Q7g",
  "aud": [
    "isim"
  ],
  "auth_time": 1763724261,
  "exp": 1763727261,
  "groups": [
    "TestGroup1",
    "TestGroup2",
    "TestGroup3"
  ],
  "iat": 1763724261,
  "iss": "https://www.iamlab.ibm.com",
  "jti": "e898103e-0fd1-447e-9c2f-b7993b19199b",
  "rat": 1763724261,
  "rt_hash": "DfjyY-zvXcInseU8mbd5Lg",
  "sid": "08f565d1-26e7-4228-aabf-ada4a2bf063e",
  "sub": "container_testuser"
}

The ID Token now contains the sid claim. This session ID is used to track the session in the RP.

After calling the logout endpoint a Logout Token is sent to the RP, that looks like this:

Header:

{
  "alg": "RS256",
  "kid": "server_key",
  "typ": "logout+jwt"
}

Payload:

{
  "aud": "isim",
  "events": {
    "http://schemas.openid.net/event/backchannel-logout": {}
  },
  "exp": 1763713605,
  "iat": 1763712705,
  "iss": "https://www.iamlab.ibm.com",
  "jti": "1880570e-92b4-4fb4-bbf3-b374d64ceb5e",
  "nbf": 1763712705,
  "sid": "08f565d1-26e7-4228-aabf-ada4a2bf063e",
  "sub": "container_testuser"
}

Note that the value of the sid claim is the same as in the ID Token. The RP should use this value to keep track of the session, and terminate it during SLO.