Skip to content
Latest (currently 2026.11.0) has the newest features, bug fixes, and CVE patches of Solo Enterprise for agentgateway.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Set up interactive elicitation

Page as Markdown

Set up the identity provider, STS, and agentgateway UI that interactive elicitation uses.

Set up the identity provider (IdP), security token service (STS), and Solo Enterprise for agentgateway UI that interactive elicitation uses. In the interactive flow, users authorize an upstream OAuth provider in the UI. Brokered elicitation does not use this setup. For that flow, see Set up brokered elicitation.

Before you begin

  1. Install the Solo Enterprise for agentgateway control plane by following the quick start guide.
  2. Save your Solo Enterprise for agentgateway license key in the AGENTGATEWAY_LICENSE_KEY environment variable.
  3. Install kubectl, Helm, curl, jq, and python3.

Step 1: Set up Keycloak

The IdP authenticates the users who send MCP requests and the users who log in to the UI. The STS identifies a user by the token’s sub claim, so both logins must come from the same IdP realm. Without IdP protection, the UI cannot be used for the elicitation flow.

Install Keycloak

This example uses Keycloak as the identity provider (IdP). You can use any IdP that supports OpenID Connect (OIDC).

  1. Create a namespace for your Keycloak deployment.

    kubectl create namespace keycloak
  2. Create the Keycloak deployment.

    kubectl -n keycloak apply -f https://raw.githubusercontent.com/solo-io/gloo-mesh-use-cases/main/policy-demo/oidc/keycloak.yaml
  3. Wait for the Keycloak rollout to finish.

    kubectl -n keycloak rollout status deploy/keycloak
  4. Set the Keycloak endpoint details from the load balancer service. If you are running locally in kind and need a local IP address for the load balancer service, consider using cloud-provider-kind.

    export ENDPOINT_KEYCLOAK=$(kubectl -n keycloak get service keycloak -o jsonpath='{.status.loadBalancer.ingress[0].ip}{.status.loadBalancer.ingress[0].hostname}'):8080
    export HOST_KEYCLOAK=$(echo ${ENDPOINT_KEYCLOAK} | cut -d: -f1)
    export PORT_KEYCLOAK=$(echo ${ENDPOINT_KEYCLOAK} | cut -d: -f2)
    export KEYCLOAK_URL=http://${ENDPOINT_KEYCLOAK}
    echo $KEYCLOAK_URL
  5. Open the Keycloak URL and log in with the default admin user. To log in, use the admin username and admin password.

    open $KEYCLOAK_URL

Create a realm and test user

Create an agentgateway realm with a test client and user. The test client gets a JSON Web Token (JWT) for the user with curl, without a browser redirect.

  1. Get an access token for the Keycloak admin user. The following commands use this token to create the realm, client, and user. If you see a parsing error, run the curl command without piping to jq.

    export KEYCLOAK_TOKEN=$(curl -d "client_id=admin-cli" -d "username=admin" -d "password=admin" -d "grant_type=password" "$KEYCLOAK_URL/realms/master/protocol/openid-connect/token" | jq -r .access_token)
    echo $KEYCLOAK_TOKEN
  2. Create a dedicated agentgateway realm. The master realm that Keycloak creates by default has special admin restrictions that can cause 403 errors during logins.

    curl -s -X POST "${KEYCLOAK_URL}/admin/realms" \
     -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{"realm":"agentgateway","enabled":true}'
  3. Save the JSON Web Key Set (JWKS) endpoint for the agentgateway realm. The STS validators use this endpoint to verify the user’s JWT.

    export KEYCLOAK_JWKS_URI=${KEYCLOAK_URL}/realms/agentgateway/protocol/openid-connect/certs
    echo $KEYCLOAK_JWKS_URI
  4. Create the fe-client-1 test client. This public client allows the password grant. Use it only for testing.

    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/clients" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "clientId": "fe-client-1",
        "name": "Frontend test client",
        "enabled": true,
        "publicClient": true,
        "directAccessGrantsEnabled": true,
        "standardFlowEnabled": true,
        "redirectUris": ["*"],
        "webOrigins": ["*"]
      }'
  5. Create a user1 user with a permanent password.

    # Create the user
    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/users" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"username":"user1","firstName":"Alice","lastName":"Doe","email":"user1@example.com","enabled":true}'
    
    # Get the user ID
    USER1_ID=$(curl -s -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      "${KEYCLOAK_URL}/admin/realms/agentgateway/users" \
      | python3 -c "import sys,json; print([u['id'] for u in json.load(sys.stdin) if u['username']=='user1'][0])")
    
    # Set a permanent password
    curl -s -X PUT "${KEYCLOAK_URL}/admin/realms/agentgateway/users/$USER1_ID/reset-password" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"type":"password","value":"Password1!","temporary":false}'
  6. Get a JWT for user1 and check the issuer and user claims in the decoded payload.

    curl -s -X POST "${KEYCLOAK_URL}/realms/agentgateway/protocol/openid-connect/token" \
     -d 'grant_type=password' \
     -d 'client_id=fe-client-1' \
     -d 'username=user1' \
     -d 'password=Password1!' \
     | python3 -c "
    import sys, json, base64
    d = json.load(sys.stdin)
    payload = d['access_token'].split('.')[1]
    payload += '=' * (4 - len(payload) % 4)
    claims = json.loads(base64.b64decode(payload))
    print(json.dumps({k: claims.get(k) for k in ['iss', 'sub', 'azp', 'preferred_username']}, indent=2))
    "

    Example output:

    {
      "iss": "http://172.18.0.4:8080/realms/agentgateway",
      "sub": "0c5be8c9-8883-4d64-b5f4-2ab73940cc11",
      "azp": "fe-client-1",
      "preferred_username": "user1"
    }
    

Create clients and roles for the UI

The UI is a two-container pod with a single-page application (SPA) frontend and a gRPC-Web backend. Each container requires its own Keycloak client.

ClientTypePurposeKey settings
agw-ui-frontendPublic, PKCE (S256)Browser-side auth code flow. As a SPA, it cannot store a client secret, so PKCE replaces the client secret.publicClient: true, standardFlowEnabled: true, pkce.code.challenge.method: S256, redirectUris: http://<ui-host>/callback
agw-ui-backendConfidentialServer-side token validation and /elicitations API calls. Runs in-cluster so it can store a secret securely.publicClient: false, serviceAccountsEnabled: true, standardFlowEnabled: true. Client secret must be stored in the solo-enterprise-backend-secret Kubernetes secret.
  1. Create the client for the UI frontend.

    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/clients" \
     -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
       "clientId": "agw-ui-frontend",
       "name": "Agentgateway UI frontend client",
       "enabled": true,
       "publicClient": true,
       "directAccessGrantsEnabled": false,
       "standardFlowEnabled": true,
       "redirectUris": ["http://localhost:8090/callback"],
       "webOrigins": ["http://localhost:8090"],
       "attributes": {
         "pkce.code.challenge.method": "S256"
       }
     }'
    
    FRONTEND_CLIENT_ID=$(curl -s "${KEYCLOAK_URL}/admin/realms/agentgateway/clients?clientId=agw-ui-frontend" \
     -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
     | jq -r '.[0].id')
    
    echo $FRONTEND_CLIENT_ID
  2. Create another client for the UI backend.

    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/clients" \
    -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
    "clientId": "agw-ui-backend",
    "name": "Agentgateway UI backend client",
    "enabled": true,
    "publicClient": false,
    "directAccessGrantsEnabled": false,
    "standardFlowEnabled": true,
    "serviceAccountsEnabled": true,
    "redirectUris": ["http://localhost:8090/callback"],
    "webOrigins": ["*"]
    }'
    
    # Get the client ID
    BACKEND_CLIENT_ID=$(curl -s "${KEYCLOAK_URL}/admin/realms/agentgateway/clients?clientId=agw-ui-backend" \
    -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
    | jq -r '.[0].id')
    
    echo "Backend client ID: " $BACKEND_CLIENT_ID
    
    # Get the auto-generated secret
    BACKEND_CLIENT_SECRET=$(curl -s "${KEYCLOAK_URL}/admin/realms/agentgateway/clients/${BACKEND_CLIENT_ID}/client-secret" \
    -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
    | jq -r '.value')
    
    echo "Backend client secret: " $BACKEND_CLIENT_SECRET
  3. Store the client secret in a Kubernetes secret. This secret is referenced when you install the Solo Enterprise for agentgateway UI in a later step.

    kubectl apply -f - <<EOF
    apiVersion: v1
    kind: Secret
    metadata:
      name: solo-enterprise-backend-secret
      namespace: agentgateway-system
    type: Opaque
    stringData:
      clientSecret: ${BACKEND_CLIENT_SECRET}
    EOF
  4. Create an admins group and add user1 to it. This user logs in to the UI to approve elicitations. The UI maps the admins group to the global.Admin role, which grants full administrative access.

    # Get the user1 ID
    USER1_ID=$(curl -s -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      "${KEYCLOAK_URL}/admin/realms/agentgateway/users" \
      | python3 -c "import sys,json; print([u['id'] for u in json.load(sys.stdin) if u['username']=='user1'][0])")
    
    # Create the admins group
    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/groups" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"name":"admins"}'
    
    # Get the group ID
    GROUP_ID=$(curl -s -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      "${KEYCLOAK_URL}/admin/realms/agentgateway/groups" \
      | python3 -c "import sys,json; print([g['id'] for g in json.load(sys.stdin) if g['name']=='admins'][0])")
    
    # Add user1 to the admins group
    curl -s -X PUT "${KEYCLOAK_URL}/admin/realms/agentgateway/users/$USER1_ID/groups/$GROUP_ID" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN"
  5. Create a Groups client scope and add it to all clients in the agentgateway realm. The UI requires the Groups claim to be present in the access token to apply RBAC. The scope adds group membership as a Groups claim to the access token, ID token, and userinfo endpoint. The UI maps claim values to the following roles:

    • admins → global.Admin: Full administrative access
    • writers → global.Writer: Read and write access
    • readers → global.Reader: Read-only access

    If a JWT is sent that does not include the Groups claim, the UI rejects the user. Note that the claim name requires a capital G as defined in the UI RBAC configmap.

    # Creates a client scope named groups in the agentgateway realm
    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/client-scopes" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{"name":"groups","description":"Adds group membership as a Groups claim to tokens","protocol":"openid-connect","attributes":{"include.in.token.scope":"true"}}'
    
    # Get the ID of the scope
    SCOPE_ID=$(curl -s -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      "${KEYCLOAK_URL}/admin/realms/agentgateway/client-scopes" \
      | python3 -c "import sys,json; print([s['id'] for s in json.load(sys.stdin) if s['name']=='groups'][0])")
    
    # Add protocol mapper to the groups client scope
    # The groups claim is added to access tokens and ID tokens
    curl -s -X POST "${KEYCLOAK_URL}/admin/realms/agentgateway/client-scopes/$SCOPE_ID/protocol-mappers/models" \
      -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name":"groups","protocol":"openid-connect","protocolMapper":"oidc-group-membership-mapper",
        "config":{"full.path":"false","introspection.token.claim":"true","userinfo.token.claim":"true",
        "id.token.claim":"true","access.token.claim":"true","claim.name":"Groups","jsonType.label":"String"}
      }'
    
    # Add groups scope to all clients in agentgateway realm
    for CLIENT in fe-client-1 agw-ui-frontend agw-ui-backend; do
      CLIENT_UUID=$(curl -s -H "Authorization: Bearer $KEYCLOAK_TOKEN" \
        "${KEYCLOAK_URL}/admin/realms/agentgateway/clients" \
        | python3 -c "import sys,json; print([c['id'] for c in json.load(sys.stdin) if c['clientId']=='$CLIENT'][0])")
      curl -s -X PUT "${KEYCLOAK_URL}/admin/realms/agentgateway/clients/$CLIENT_UUID/default-client-scopes/$SCOPE_ID" \
        -H "Authorization: Bearer $KEYCLOAK_TOKEN"
    done
  6. Get a JWT for user1 and verify that you see the Groups claim in the decoded token payload.

    curl -s -X POST "${KEYCLOAK_URL}/realms/agentgateway/protocol/openid-connect/token" \
     -d 'grant_type=password' \
     -d 'client_id=fe-client-1' \
     -d 'username=user1' \
     -d 'password=Password1!' \
     | python3 -c "
    import sys, json, base64
    d = json.load(sys.stdin)
    payload = d['access_token'].split('.')[1]
    payload += '=' * (4 - len(payload) % 4)
    print(json.dumps(json.loads(base64.b64decode(payload)), indent=2))
    "

    Example output:

    {
       "exp": 1774891610,
       "iat": 1774891310,
       "jti": "997db90e-553c-4436-802f-736d3988259d",
       "iss": "http://172.18.0.4:8080/realms/agentgateway",
       "aud": "account",
       "sub": "0c5be8c9-8883-4d64-b5f4-2ab73940cc11",
       "typ": "Bearer",
       "azp": "fe-client-1",
       "sid": "e62fc373-0e4a-4837-8bc6-b07b3a840643",
       "acr": "1",
       "allowed-origins": [
          "*"
       ],
       "realm_access": {
          "roles": [
             "offline_access",
             "uma_authorization",
             "default-roles-agentgateway"
          ]
       },
       "resource_access": {
          "account": {
             "roles": [
             "manage-account",
             "manage-account-links",
             "view-profile"
             ]
          }
       },
       "scope": "groups profile email",
       "email_verified": false,
       "Groups": [
          "admins"
       ],
       "name": "Alice Doe",
       "preferred_username": "user1",
       "given_name": "Alice",
       "family_name": "Doe",
       "email": "user1@example.com"
    }
    

Step 2: Register an OAuth app

Register an OAuth app with the upstream provider. Users authorize this app during interactive elicitation. This example uses GitHub. You create the Kubernetes Secret for the app’s client secret later, with the MCP backend and policy in the GitHub guide. The Secret must be in the same namespace as the policy that references it.

  1. Follow the steps to register a GitHub OAuth app and retrieve your client ID and client secret. During registration, enter the following details:

    • Homepage URL: Set to your application’s homepage URL, such as http://www.example.com.
    • Authorization callback URL: Set to http://localhost:8090/elicitations. This URL redirects users back to the elicitation view in the Solo Enterprise for agentgateway UI after authorization.
  2. Store the client ID and secret in environment variables. The GitHub guide uses these values to configure the backend policy and create the client Secret.

    export GITHUB_CLIENT_ID='<your-oauth-app-client-id>'
    export GITHUB_CLIENT_SECRET='<your-oauth-app-client-secret>'

Step 3: Enable the STS

The security token service (STS) runs in the Solo Enterprise for agentgateway controller and serves port 7777. It uses three validator lists to authenticate the callers of its endpoints. The STS requires at least one entry in each list, and it does not start if a list is empty.

Validator listProtectsWhat it validates
subjectValidators/oauth2/token (token exchange)The user’s JWT from your IdP, which identifies the user in the exchange.
actorValidators/oauth2/tokenThe proxy’s Kubernetes service account token, which authenticates the proxy to the STS.
apiValidators/elicitations APICalls to list, create, update, and delete elicitations, such as calls from the Solo Enterprise for agentgateway UI. These calls send the user’s JWT, so a k8s validator rejects them with a 401 response.
  1. Save the current Helm values so that the upgrade keeps your installation settings.

    helm get values enterprise-agentgateway -n agentgateway-system -o yaml > values.yaml
  2. Create a Helm values file with the STS settings. The unquoted heredoc substitutes KEYCLOAK_JWKS_URI before Helm reads the file.

    cat > sts-values.yaml <<EOF
    tokenExchange:
      enabled: true
      issuer: "enterprise-agentgateway.agentgateway-system.svc.cluster.local:7777"
      tokenExpiration: 24h
      subjectValidators:
      - validatorType: remote
        remoteConfig:
          url: "${KEYCLOAK_JWKS_URI}"
      actorValidators:
      - validatorType: k8s
      apiValidators:
      - validatorType: remote
        remoteConfig:
          url: "${KEYCLOAK_JWKS_URI}"
      maintenance:
        enabled: true
    EOF
    Review the following table to understand this configuration.
    SettingDescription
    enabledEnable the STS.
    issuerThe issuer of the tokens that the STS mints, typically the address of the control plane service on port 7777.
    tokenExpirationThe lifetime of the tokens that the STS mints, such as 24h for 24 hours.
    subjectValidatorsValidators for the user’s JWT during token exchange. Set the type to remote and provide the JWKS URL of your IdP. Validators are tried in order.
    actorValidatorsValidators for the proxy’s identity. Set the type to k8s so that the STS validates the proxy’s Kubernetes service account token.
    apiValidatorsValidators for calls to the elicitations API. Set the type to remote and provide the JWKS URL of your IdP.
    maintenance.enabledOptional. Enable the periodic janitor that deletes expired, unused tokens and cleans up their related elicitations. Defaults to false. To tune the cleanup interval and retention periods, see Token maintenance.

    Note

    Earlier releases used the singular subjectValidator, actorValidator, and apiValidator fields. These fields are deprecated. If you set both forms, the STS tries the singular validator first.

  3. Install or upgrade Solo Enterprise for agentgateway with the STS settings.

    helm upgrade -i enterprise-agentgateway oci://us-docker.pkg.dev/solo-public/enterprise-agentgateway/charts/enterprise-agentgateway \
      -n agentgateway-system \
      --create-namespace \
      --version v2026.11.0 \
      -f values.yaml -f sts-values.yaml
  4. Verify that the controller is running and that the control plane service exposes port 7777 for the STS.

    kubectl get deploy -n agentgateway-system enterprise-agentgateway
    kubectl get svc -n agentgateway-system enterprise-agentgateway

    Example output:

    NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
    enterprise-agentgateway   1/1     1            1           2m51s
    
    NAME                      TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
    enterprise-agentgateway   ClusterIP   10.96.195.136   <none>        9978/TCP,9093/TCP,7777/TCP   17h
    

Note

Each MCP backend configures its OAuth provider with typed fields on the EnterpriseAgentgatewayPolicy resource, so no OAuth Secret is required at the Helm level. For a global fallback provider for backends that do not specify their own configuration, you can set tokenExchange.elicitation.secretName to the name of an opaque Secret. This fallback uses the legacy Secret format and is mutually exclusive with the typed backend.entElicitation field on a given backend.

Step 4: Install the UI

The UI shows pending elicitations and runs the OAuth authorization for each one. It connects to the Solo Enterprise for agentgateway control plane in the agentgateway-system namespace, and uses Keycloak to authenticate users.

  1. Save the following Helm values for the UI. The UI is the enterprise-agentgateway-ui subchart of the enterprise-agentgateway chart, so it reuses the license and the control plane connection from your existing release.

    cat > solo-ui-values.yaml << EOF
    ui:
      enabled: true
      oidc:
        issuer: ${KEYCLOAK_URL}/realms/agentgateway
        clientId: agw-ui-frontend
      backend:
        oidc:
          clientId: agw-ui-backend
          secretRef: solo-enterprise-backend-secret
    EOF
  2. Upgrade your Solo Enterprise for agentgateway release with the UI values.

    helm upgrade -i enterprise-agentgateway oci://us-docker.pkg.dev/solo-public/enterprise-agentgateway/charts/enterprise-agentgateway \
      -n agentgateway-system \
      --version v2026.11.0 \
      -f values.yaml -f sts-values.yaml -f solo-ui-values.yaml
  3. Set the controller’s callback URL to the UI elicitations page. When a request needs a credential that the STS does not have, the proxy returns this URL to the client. The user opens the URL to authorize access in the UI.

    cat > callback-values.yaml <<'EOF'
    controller:
      extraEnv:
        CALLBACK_URL: "http://localhost:8090/elicitations"
    EOF
    
    helm upgrade -i enterprise-agentgateway oci://us-docker.pkg.dev/solo-public/enterprise-agentgateway/charts/enterprise-agentgateway \
      -n agentgateway-system \
      --version v2026.11.0 \
      -f values.yaml -f sts-values.yaml -f solo-ui-values.yaml -f callback-values.yaml
    kubectl -n agentgateway-system rollout status deployment/enterprise-agentgateway
    SettingDescription
    controller.extraEnv.CALLBACK_URLThe UI page that the user opens to complete the authorization. This URL and the callback URL of your OAuth app must both use a hostname that the user’s browser can reach. If not set, the proxy returns the placeholder https://example.com/elicitation. Changing this value restarts the controller pod and wipes the ephemeral SQLite database, which removes all pending elicitations and stored tokens.
  4. Port-forward the UI to your local machine.

    kubectl port-forward service/enterprise-agentgateway-ui -n agentgateway-system 8090:80
  5. Open the UI. You are redirected to Keycloak for login. Log in with the user1 credentials (user1 / Password1!). After login, you are redirected back to the UI and can see the Elicitation view.

Step 5: Allow routes from other namespaces

The GitHub guide creates its route in the interactive-elicitation namespace. Make sure that the Gateway accepts routes from other namespaces.

kubectl apply -f- <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: agentgateway-proxy
  namespace: agentgateway-system
spec:
  gatewayClassName: enterprise-agentgateway
  listeners:
    - name: http
      port: 80
      protocol: HTTP
      allowedRoutes:
        namespaces:
          from: All
EOF

Next steps

Continue with Elicit a GitHub credential to configure an MCP backend, approve the elicitation in the UI, and retry the request with the stored credential.