Neuralbank OIDC

Executable path. Migration Toolkit only. One product, neuralbank-oidc, and its own Gateway in business-apis.

Do not open APIShift, the wallet, or the shared Gateway in module 11 during this take.

The Gateway already installed and APIcast production both return 200 for GET /api/v1/customers with a Bearer token. Both call neuralbank-backend-svc.neuralbank-stack.svc.cluster.local:8080.

  • APIcast production: https://neuralbank-oidc-3scale-apicast-production.apps.cluster.example.com

  • Gateway already installed: https://neuralbank.apps.cluster.example.com

  • Host the Toolkit creates: https://neuralbank-oidc-business-apis.apps.cluster.example.com

In 3scale, show account Neuralbank, application neuralbank-frontend-azp, client_id neuralbank-frontend, plan Basic (60/min). Skip the other application: its short client_id does not match the token.

Step 1: Products in 3scale

oc get product,backend,activedoc -n 3scale-system | grep -E 'neuralbank|NAME'
oc get product neuralbank-oidc-product -n 3scale-system -o wide

Step 2: Call the API on both front doors

The lab shell has python3, not python. Run the block as a whole. An empty $TOKEN makes the Gateway return 302.

TOKEN=$(curl -s -X POST \
  "https://rhbk.apps.cluster.example.com/realms/neuralbank/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=password" \
  -d "client_id=neuralbank-frontend" \
  -d "username=robert.anderson@email.com" \
  -d "password=Welcome123" \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])')

curl -s -o /dev/null -w "neuralbank RHCL: %{http_code}\n" \
  -H "Authorization: Bearer $TOKEN" \
  "https://neuralbank.apps.cluster.example.com/api/v1/customers"

curl -s -o /dev/null -w "neuralbank 3scale: %{http_code}\n" \
  -H "Authorization: Bearer $TOKEN" \
  "https://neuralbank-oidc-3scale-apicast-production.apps.cluster.example.com/api/v1/customers"

Expected:

neuralbank RHCL: 200
neuralbank 3scale: 200

APIcast returns 403 when the access token has no aud claim. Client neuralbank-frontend includes an audience mapper, so aud and azp are both neuralbank-frontend.

Step 3: Workload

oc get pods -n neuralbank-stack
oc get svc neuralbank-backend-svc -n neuralbank-stack
oc get gateway -n neuralbank-stack

The migration moves policy and the edge. The Deployment stays.

Step 4: Migration Toolkit

  1. Open https://migration-toolkit.apps.cluster.example.com.

  2. Confirm the 3scale URL and token, then Test connection.

  3. New project. Target namespace: business-apis.

  4. Select only neuralbank-oidc and convert it.

  5. In the YAML, show without editing: Gateway port 8080, edge Route to neuralbank-oidc-gateway-istio, host neuralbank-oidc-business-apis.apps.cluster.example.com, API paths to neuralbank-backend-svc, docs route /q with no AuthPolicy, JWT AuthPolicy with the neuralbank issuer and prefix Bearer, ReferenceGrant in neuralbank-stack, RateLimitPolicy 60/min (Premium 300/min is only in the plans annotation), APIProduct openAPISpecURL on /q/openapi?format=json.

  6. Apply into business-apis.

oc get gateway,route,httproute,authpolicy,ratelimitpolicy,apiproduct -n business-apis
oc get referencegrant -n neuralbank-stack

Step 5: Call the host the Toolkit created

Run this after Apply.

NB=https://neuralbank-oidc-business-apis.apps.cluster.example.com

curl -s -o /dev/null -w "openapi: %{http_code}\n" "$NB/q/openapi?format=json"
curl -s -o /dev/null -w "sin token: %{http_code}\n" "$NB/api/v1/customers"

TOKEN=$(curl -s -X POST \
  "https://rhbk.apps.cluster.example.com/realms/neuralbank/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=password" \
  -d "client_id=neuralbank-frontend" \
  -d "username=robert.anderson@email.com" \
  -d "password=Welcome123" \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])')

curl -s -o /dev/null -w "bearer: %{http_code}\n" \
  -H "Authorization: Bearer $TOKEN" \
  "$NB/api/v1/customers"

Expected: OpenAPI 200 without a token, no token 401, Bearer 200. The 61st call in the same minute is 429.

If the host does not answer:

oc get route -n business-apis