Introspect OAuth2 refresh tokens

RFC 7662 lets clients introspect any OAuth2 token, but the endpoint
only resolved access tokens. Look up refresh tokens too, honor the
optional token_type_hint to drive lookup order with a fallback to the
other table, and report revoked or expired refresh tokens as inactive.

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-04-28 09:24:06 +02:00
committed by Émile Ré
parent 62f05b3ff2
commit 2418079785
5 changed files with 286 additions and 20 deletions

View File

@@ -252,6 +252,7 @@ func (h *OAuth2Handler) IntrospectHandler(w http.ResponseWriter, r *http.Request
r.Context(),
client.ID,
in.Token,
in.TokenTypeHint,
)
if err != nil || result == nil {
httpserver.RenderJSON(w, http.StatusOK, types.InactiveIntrospectResponse())