summaryrefslogtreecommitdiff
path: root/test/e2e_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/e2e_test.go')
-rw-r--r--test/e2e_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/e2e_test.go b/test/e2e_test.go
index c88f5fc6..40ed9439 100644
--- a/test/e2e_test.go
+++ b/test/e2e_test.go
@@ -277,6 +277,19 @@ func TestAuthx(t *testing.T) {
project := x.Must(serde.FromJSON[map[string]string](response.Body))
assert.Equal(t, "foo", project["name"])
})
+
+ t.Run("token can be introspected", func(t *testing.T) {
+ client := conf.Client(ctx, credentials)
+
+ io := bytes.NewBuffer(nil)
+ assert.NoError(t, serde.ToJSON(io, map[string]string{"token": credentials.AccessToken}))
+ response := x.Must(client.Post("http://idp.example.com:8080/oauth/introspect", "application/json", io))
+ require.Equal(t, http.StatusOK, response.StatusCode)
+
+ claims := x.Must(serde.FromJSON[map[string]interface{}](response.Body))
+ assert.Equal(t, true, claims["active"])
+ assert.Equal(t, "gid://example/Authn::User/1", claims["sub"])
+ })
})
})
}