Skip to content

Conversation

@cdanis
Copy link
Contributor

@cdanis cdanis commented Sep 20, 2025

Closes #197

@cdanis cdanis changed the title feat: frontchannel logout feat: front-channel logout Sep 20, 2025
Copy link
Owner

@sevensolutions sevensolutions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cdanis
thx for this PR 👍
I think you're still working on it, but I thought I'd start by adding my two cents 😂

//Scopes: []string{"openid", "profile", "email"},
CallbackUri: "/oidc/callback",
LogoutUri: "/logout",
FrontChannelLogoutUri: "/frontchannel-logout",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we support environment variable expansion?

toa.handleLogout(rw, req, session)
return
}
if toa.Config.FrontChannelLogoutUri != "" && strings.HasPrefix(req.RequestURI, toa.Config.FrontChannelLogoutUri) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer to move this before the if err == nil && session != nil { and then pass in the "optional" session and claims.
Then we can handle both cases (with and without session) within the handleFrontChannelLogout function and we have everything in one place.

Eg:

session, updateSession, claims, err := toa.getSessionForRequest(req)

// Handle front-channel logout
if err == nil && strings.HasPrefix(req.RequestURI, toa.Config.FrontChannelLogoutUri) {
	toa.handleFrontChannelLogout(rw, req, session, claims)
	return
}

What do you think?

@cdanis cdanis marked this pull request as draft September 26, 2025 20:25
@cdanis
Copy link
Contributor Author

cdanis commented Sep 26, 2025

I'll get back to this soon I hope 😅 but yes, not done yet. Aside from review comments, I also wanted to generate formatted error responses, and do some more testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 FR: Support front-channel logout

2 participants