{
  "name": "introspect-p1",
  "condition": "${find(request.uri.path, '^/p1-introspect')}",
  "properties": {
    "pingOneResourceId": "<resourceId>",
    "pingOneIntrospectUrl": "https://auth.pingone.com/<envId>/as/introspect"
  },
  "handler": {
    "type": "Chain",
    "config": {
      "filters": [
        {
          "type": "OAuth2ResourceServerFilter",
          "config": {
            "scopes": [
              "resource:access"
            ],
            "requireHttps": false,
            "accessTokenResolver": {
              "type": "TokenIntrospectionAccessTokenResolver",
              "config": {
                "endpoint": "&{pingOneIntrospectUrl}",
                "providerHandler": {
                  "type": "Chain",
                  "config": {
                    "filters": [
                      {
                        "type": "ClientSecretBasicAuthenticationFilter",
                        "config": {
                          "clientId": "&{pingOneResourceId}",
                          "clientSecretId": "pingone.resource.secret",
                          "secretsProvider": {
                            "type": "SystemAndEnvSecretStore"
                          }
                        }
                      }
                    ],
                    "handler": "ClientHandler"
                  }
                }
              }
            }
          }
        }
      ],
      "handler": {
        "type": "StaticResponseHandler",
        "config": {
          "status": 200,
          "headers": {
            "Content-Type": [
              "text/html; charset=UTF-8"
            ]
          },
          "entity": "<html><body><p>Decoded access_token: <code>${contexts.oauth2.accessToken.info}</code></p></body></html>"
        }
      }
    }
  }
}