diff --git a/pkg/oidcclient/filesession/cachefile_test.go b/pkg/oidcclient/filesession/cachefile_test.go index b1e1c984..39ac87fb 100644 --- a/pkg/oidcclient/filesession/cachefile_test.go +++ b/pkg/oidcclient/filesession/cachefile_test.go @@ -38,6 +38,13 @@ var validSession = sessionCache{ IDToken: &oidctypes.IDToken{ Token: "test-id-token", Expiry: metav1.NewTime(time.Date(2020, 10, 20, 19, 42, 07, 0, time.UTC).Local()), + Claims: map[string]interface{}{ + "foo": "bar", + "nested": map[string]interface{}{ + "key1": "value1", + "key2": "value2", + }, + }, }, RefreshToken: &oidctypes.RefreshToken{ Token: "test-refresh-token", diff --git a/pkg/oidcclient/filesession/testdata/valid.yaml b/pkg/oidcclient/filesession/testdata/valid.yaml index 67602c7b..e0d1943c 100644 --- a/pkg/oidcclient/filesession/testdata/valid.yaml +++ b/pkg/oidcclient/filesession/testdata/valid.yaml @@ -20,5 +20,10 @@ sessions: id: expiryTimestamp: "2020-10-20T19:42:07Z" token: test-id-token + claims: + foo: bar + nested: + key1: value1 + key2: value2 refresh: token: test-refresh-token diff --git a/pkg/oidcclient/oidctypes/oidctypes.go b/pkg/oidcclient/oidctypes/oidctypes.go index 94f5dcc9..d3d1b658 100644 --- a/pkg/oidcclient/oidctypes/oidctypes.go +++ b/pkg/oidcclient/oidctypes/oidctypes.go @@ -31,6 +31,9 @@ type IDToken struct { // Expiry is the optional expiration time of the ID token. Expiry v1.Time `json:"expiryTimestamp,omitempty"` + + // Claims are the claims expressed by the Token. + Claims map[string]interface{} `json:"claims,omitempty"` } // Token contains the elements of an OIDC session.