feat: update end session request to pass all params according to specification
This commit is contained in:
parent
b917cdc2e3
commit
e40e071bea
3 changed files with 12 additions and 5 deletions
|
@ -1,10 +1,12 @@
|
|||
package oidc
|
||||
|
||||
// EndSessionRequest for the RP-Initiated Logout according to:
|
||||
//https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout
|
||||
// https://openid.net/specs/openid-connect-rpinitiated-1_0.html#RPLogout
|
||||
type EndSessionRequest struct {
|
||||
IdTokenHint string `schema:"id_token_hint"`
|
||||
ClientID string `schema:"client_id"`
|
||||
PostLogoutRedirectURI string `schema:"post_logout_redirect_uri"`
|
||||
State string `schema:"state"`
|
||||
IdTokenHint string `schema:"id_token_hint"`
|
||||
LogoutHint string `schema:"logout_hint"`
|
||||
ClientID string `schema:"client_id"`
|
||||
PostLogoutRedirectURI string `schema:"post_logout_redirect_uri"`
|
||||
State string `schema:"state"`
|
||||
UILocales Locales `schema:"ui_locales"`
|
||||
}
|
||||
|
|
|
@ -73,6 +73,8 @@ func ValidateEndSessionRequest(ctx context.Context, req *oidc.EndSessionRequest,
|
|||
|
||||
session := &EndSessionRequest{
|
||||
RedirectURI: ender.DefaultLogoutRedirectURI(),
|
||||
LogoutHint: req.LogoutHint,
|
||||
UILocales: req.UILocales,
|
||||
}
|
||||
if req.IdTokenHint != "" {
|
||||
claims, err := VerifyIDTokenHint[*oidc.IDTokenClaims](ctx, req.IdTokenHint, ender.IDTokenHintVerifier(ctx))
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"time"
|
||||
|
||||
jose "github.com/go-jose/go-jose/v4"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"github.com/zitadel/oidc/v3/pkg/oidc"
|
||||
)
|
||||
|
@ -170,6 +171,8 @@ type EndSessionRequest struct {
|
|||
ClientID string
|
||||
IDTokenHintClaims *oidc.IDTokenClaims
|
||||
RedirectURI string
|
||||
LogoutHint string
|
||||
UILocales []language.Tag
|
||||
}
|
||||
|
||||
var ErrDuplicateUserCode = errors.New("user code already exists")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue