oidc: add standard references
- IDTokenClaims - IntrospectionResponse - UserInfo
This commit is contained in:
parent
54eae928c9
commit
c7f1319b39
3 changed files with 10 additions and 0 deletions
|
@ -11,6 +11,10 @@ type ClientAssertionParams struct {
|
||||||
ClientAssertionType string `schema:"client_assertion_type"`
|
ClientAssertionType string `schema:"client_assertion_type"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IntrospectionResponse implements RFC 7662, section 2.2 and
|
||||||
|
// OpenID Connect Core 1.0, section 5.1 (UserInfo).
|
||||||
|
// https://www.rfc-editor.org/rfc/rfc7662.html#section-2.2.
|
||||||
|
// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims.
|
||||||
type IntrospectionResponse struct {
|
type IntrospectionResponse struct {
|
||||||
Active bool `json:"active"`
|
Active bool `json:"active"`
|
||||||
Scope SpaceDelimitedArray `json:"scope,omitempty"`
|
Scope SpaceDelimitedArray `json:"scope,omitempty"`
|
||||||
|
|
|
@ -105,6 +105,10 @@ func (a *AccessTokenClaims) UnmarshalJSON(data []byte) error {
|
||||||
return unmarshalJSONMulti(data, (*atcAlias)(a), &a.Claims)
|
return unmarshalJSONMulti(data, (*atcAlias)(a), &a.Claims)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IDTokenClaims extends TokenClaims by further implementing
|
||||||
|
// OpenID Connect Core 1.0, sections 3.1.3.6 (Code flow),
|
||||||
|
// 3.2.2.10 (implicit), 3.3.2.11 (Hybrid) and 5.1 (UserInfo).
|
||||||
|
// https://openid.net/specs/openid-connect-core-1_0.html#toc
|
||||||
type IDTokenClaims struct {
|
type IDTokenClaims struct {
|
||||||
TokenClaims
|
TokenClaims
|
||||||
NotBefore Time `json:"nbf,omitempty"`
|
NotBefore Time `json:"nbf,omitempty"`
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package oidc
|
package oidc
|
||||||
|
|
||||||
|
// UserInfo implements OpenID Connect Core 1.0, section 5.1.
|
||||||
|
// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims.
|
||||||
type UserInfo struct {
|
type UserInfo struct {
|
||||||
Subject string `json:"sub,omitempty"`
|
Subject string `json:"sub,omitempty"`
|
||||||
UserInfoProfile
|
UserInfoProfile
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue