-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(OP): add back channel logout support (#671)
* feat: add configuration support for back channel logout * logout token * indicate back channel logout support in discovery endpoint
- Loading branch information
Showing
8 changed files
with
151 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,3 +242,39 @@ func TestIDTokenClaims_GetUserInfo(t *testing.T) { | |
got := idTokenData.GetUserInfo() | ||
assert.Equal(t, want, got) | ||
} | ||
|
||
func TestNewLogoutTokenClaims(t *testing.T) { | ||
want := &LogoutTokenClaims{ | ||
Issuer: "zitadel", | ||
Subject: "[email protected]", | ||
Audience: Audience{"foo", "[email protected]"}, | ||
Expiration: 12345, | ||
JWTID: "jwtID", | ||
Events: map[string]any{ | ||
"http://schemas.openid.net/event/backchannel-logout": struct{}{}, | ||
}, | ||
SessionID: "sessionID", | ||
Claims: nil, | ||
} | ||
|
||
got := NewLogoutTokenClaims( | ||
want.Issuer, | ||
want.Subject, | ||
want.Audience, | ||
want.Expiration.AsTime(), | ||
want.JWTID, | ||
want.SessionID, | ||
1*time.Second, | ||
) | ||
|
||
// test if the dynamic timestamp is around now, | ||
// allowing for a delta of 1, just in case we flip on | ||
// either side of a second boundry. | ||
nowMinusSkew := NowTime() - 1 | ||
assert.InDelta(t, int64(nowMinusSkew), int64(got.IssuedAt), 1) | ||
|
||
// Make equal not fail on dynamic timestamp | ||
got.IssuedAt = 0 | ||
|
||
assert.Equal(t, want, got) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters