-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logout via Query Params #3
Conversation
* Remove "cookieName" configuration and assume "<serviceName>-jwt" as cookie name * Adjust `SetJwtCookieComponent` to handle logout (remove JWT cookie and trigger redirect) if `?logout=<serviceName>` query parameter is present Closes: flownative#2
That all looks pretty reasonable from my side and probably ready to merge, BUT why remove the cookieName configuration? Can't it be |
{ | ||
$this->removeJwtCookie($componentContext); | ||
$this->logger->info(sprintf('OpenID Connect Client: (%s) Logout requested (via query parameter) removing JWT cookie for service "%s".', get_class($this), $this->options['serviceName'])); | ||
$componentContext->replaceHttpResponse($componentContext->getHttpResponse()->withHeader('Location', (string)$componentContext->getHttpRequest()->getUri()->withQuery(''))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is a bit magic.. It redirects to the current URI without query params. If other params are required they would be missing. I think we have to revise this part, but without the redirect the account is already authenticated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a defined "afterLogout" URL?
Thanks for the review!
This package already has the notion of a "serviceName" to make it multi-tenant capable. Instead of duplicating the configuration everywhere we thought it would be better to "centralize" the oAuth tenants via the "serviceName". I'll solve this in our application layer for now, until we found a better generic approach |
Codecov Report
@@ Coverage Diff @@
## master #3 +/- ##
============================================
- Coverage 15.38% 14.88% -0.50%
- Complexity 189 194 +5
============================================
Files 9 9
Lines 481 497 +16
============================================
Hits 74 74
- Misses 407 423 +16
Continue to review full report at Codecov.
|
Gah, I guess conflict resolution via GH is a bad idea for all but the simples cases. Feel free to throw away 3ea2216 again. Anyway, this touches code that has changed a bit in the meantime. |
The suggested solution was breaking and I'm not really happy with it.. Closing for now to remove this from my pending PRs |
Importing fixes from base repository
cookie name
SetJwtCookieComponent
to handle logout (remove JWT cookieand trigger redirect) if
?logout=<serviceName>
query parameter ispresent
Closes: #2