Identity Server

Run WSO2 Identity Server 7 on OpenShift and use it as the OAuth2 and OpenID Connect issuer for APIs and gateways.

Updated CompTech Team

WSO2 Identity Server 7 is the identity product in this stack. It authenticates users, holds applications (OAuth2 clients), and issues tokens that API Manager and Connectivity Link can check. The supported 7.x line includes 7.1 and 7.2; confirm the newest supported 7.x on the WSO2 support matrix and mirror that image. The Helm chart is wso2/identity-server.

Identity Server is the issuer. API Manager is the API product layer. When the two are deployed together, Identity Server 7 acts as a third-party key manager, not as API Manager's resident key manager. In that pattern, tenancy in API Manager is not available through Identity Server 7. Plan tenants in API Manager only if you have accepted that limit or you are using API Manager's own resident key manager for those tenants.

Prerequisites

  • OpenShift, oc and helm.
  • DNS for the Identity Server route, and a certificate the callers will trust. On a lab, tls.termination: edge is enough. On a site that inspects tokens at more than one hop, terminate TLS where your standard says to.
  • The same OpenShift constraint as the other WSO2 products: the chart must not force a UID, because OpenShift assigns one.

Install

helm repo add wso2 https://helm.wso2.com
helm repo update
helm search repo wso2/identity-server --versions
oc create namespace wso2
helm install is wso2/identity-server \
  --namespace wso2 \
  --version 7.2.0 \
  -f openshift-values.yaml
oc get pods -n wso2 -w

helm search lists the chart versions. The command above pins 7.2.0 as the 7.2 line. If that version is not in the list, pass the 7.x chart the search printed for the image you mirrored, and record both in the release note. In openshift-values.yaml, disable the fixed run-as user and AppArmor, and set executable modes on script ConfigMaps, as the Micro Integrator lab does. Create a Route to the HTTPS listener on port 9443.

Change the administrator password before the Route is reachable beyond the lab. Store it in a Secret.

The console is https://<route>/console. Create a user and an application there for the first test. For anything you will repeat, export the application as configuration and put it in Git. A console click is not a deployment.

Issue a token

Register an OAuth2 application with the client-credentials grant for a machine client, or the authorization-code grant for a user-facing app. Then:

curl -sk -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d "grant_type=client_credentials" \
  "https://$(oc get route is -n wso2 -o jsonpath='{.spec.host}')/oauth2/token"

A JSON body with access_token means the issuer is live. Decode the token and read iss, exp and the scopes. iss must be the URL that other services will use as the issuer, which is the external Route URL, not the in-cluster Service URL. If those differ, set the hostname in the Identity Server configuration before any other product caches the wrong issuer.

The endpoints API Manager needs when you register this server as a key manager are:

Purpose Path
Well-known configuration /oauth2/token/.well-known/openid-configuration
Issuer /oauth2/token
Token /oauth2/token
Introspection /oauth2/introspect
Dynamic client registration /api/identity/oauth2/dcr/v1.1/register
Revoke /oauth2/revoke

Prefixes are on the Identity Server host. From inside the cluster the host is the Service; from browsers and from Connectivity Link it is the Route. Be consistent in each product's configuration.

Use the token at the gateway

Two consumers in our labs:

  • API Manager, as a third-party key manager. In Publisher, add a key manager of type WSO2 Identity Server 7 and paste the endpoints above. Applications created in the Developer Portal then receive tokens that API Manager accepts. The steps are in the API Manager lab.
  • Connectivity Link AuthPolicy. Set the JWT issuer URL to this server's issuer, and attach the policy to the Gateway or the HTTPRoute. Calls without a bearer token are refused at the edge, before they reach MI.

Put group and clearance claims into the token only when the directory actually holds them. The records and staff work labs treat those claims as the access filter. A claim you add "for the demo" becomes production access.

Operate it

Back up the database the chart uses. Tokens can be reissued; users, applications and consents cannot be rediscovered. Ship Identity Server audit logs to the same store as the cluster audit log, and alert on bulk exports and on changes to an application's grants. Those two events matter more than a failed login from a script.

On a sealed site, mirror wso2/identity-server and the Helm chart, and do not point the pod at a public update URL.

Claims the other labs consume

Issue only claims the directory actually holds.

  • groups for API Manager roles and for Connectivity Link authorization.
  • clearance and unit for the records and staff work filters.
  • No claim added to make a demo pass. A demo claim becomes production access the moment the same realm is reused.

Rotate the client's secret, keep it in an OpenShift Secret, and alert on a change to the application's grants. That alert is the one that matters.

What's next

  1. API Manager: register this issuer as the key manager and subscribe an application.
  2. Micro Integrator: the backend API that a valid token is allowed to call.
  3. Connectivity Link: enforce the same issuer on a Gateway API route.