Skip to content

KEYCLOAK-2940 - draft - Backchannel Logout - #7272

Merged
pedroigor merged 9 commits into
keycloak:masterfrom
bosch-io:KEYCLOAK-2940-back-channel-logout
Aug 12, 2020
Merged

pedroigor merged 9 commits into
keycloak:masterfrom
bosch-io:KEYCLOAK-2940-back-channel-logout

Conversation

@DaSmoo

@DaSmoo DaSmoo commented Jul 16, 2020

Copy link
Copy Markdown
Contributor

Hello,

we tried to implement the back-channel logout like it's described in the opendID specification. We would like to get technical feedback.

Open Points from our side:

  • Why should we deprecate the old logout endpoint? The current GET logout will stay as it is, right?
  • Should we validate the iat claim in the logout token?
  • Should social oidc identity providers also support back-channel logout, e. g. google?
  • AuthenticationManager.backchannelLogoutClientSession()

In the past the backchannel logout was always trigger even if no RP party session existed. Now if we want to implement the concept by 100% we would need to get a valid return value from the call of the back-channel logout. At this point we would like to ask you guys for your feedback for the best implementation that would also fit to the solution.

OpenId Backchannel logout Spec: https://openid.net/specs/openid-connect-backchannel-1_0.html
RedHat ticket: https://issues.redhat.com/browse/KEYCLOAK-2940?_sscc=t

@benjamin37
benjamin37 force-pushed the KEYCLOAK-2940-back-channel-logout branch 2 times, most recently from b99d4f0 to fe222ac Compare July 16, 2020 14:59
@stianst
stianst requested a review from pedroigor July 17, 2020 10:29
@stianst

stianst commented Jul 21, 2020

Copy link
Copy Markdown
Contributor

Haven't looked at this, and hoping @pedroigor can do so soon.

With regards to "Why should we deprecate the old logout endpoint? The current GET logout will stay as it is, right?" - do you mean the RP initiated logout endpoint? There are improvements/changes we need to do there, but that is a separate issue to backchannel logout.

@DaSmoo

DaSmoo commented Jul 21, 2020

Copy link
Copy Markdown
Contributor Author

Haven't looked at this, and hoping @pedroigor can do so soon.

With regards to "Why should we deprecate the old logout endpoint? The current GET logout will stay as it is, right?" - do you mean the RP initiated logout endpoint? There are improvements/changes we need to do there, but that is a separate issue to backchannel logout.

Hey @stianst,

yes in the Ticket: https://issues.redhat.com/browse/KEYCLOAK-2940?_sscc=t there it is written down that we should mark the old logout endpoint as deprecated. We asked ourselves if we should deprecate the old logout endpoint in our contribution and integrate the existing @get part into our new LogoutEndpoint or if we should leave it as it is so our contribution doesn't get to extensive.

Greetings David

@pedroigor

Copy link
Copy Markdown
Contributor

@DaSmoo Reviewing this one today ...

@pedroigor pedroigor left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work, tks for this one. A few initial comments as a start so we can move forward depending on what you think about my comments. Basically:

  • Do not change DDL but re-use client attributes to store logout metadata. See comment.
  • A bit of nitpicking, so you could potentially revert changes that are basically changing formating.

Depending on whether or not you think my comments make sense, we should be able to reduce the size of the changeset.

@pedroigor

Copy link
Copy Markdown
Contributor

Haven't looked at this, and hoping @pedroigor can do so soon.
With regards to "Why should we deprecate the old logout endpoint? The current GET logout will stay as it is, right?" - do you mean the RP initiated logout endpoint? There are improvements/changes we need to do there, but that is a separate issue to backchannel logout.

Hey @stianst,

yes in the Ticket: https://issues.redhat.com/browse/KEYCLOAK-2940?_sscc=t there it is written down that we should mark the old logout endpoint as deprecated. We asked ourselves if we should deprecate the old logout endpoint in our contribution and integrate the existing @get part into our new LogoutEndpoint or if we should leave it as it is so our contribution doesn't get to extensive.

Greetings David

I would also keep the current one and deal with it later.

@benjamin37
benjamin37 force-pushed the KEYCLOAK-2940-back-channel-logout branch from fe222ac to 9b7cee0 Compare July 22, 2020 12:44
@benjamin37

benjamin37 commented Jul 22, 2020 •

Copy link
Copy Markdown
Contributor

Hi @pedroigor,

thanks for your feedback. We changed the PR according to your comments. We still have an issue with the cross dc tests running on Travis CI. Do you have an idea why these tests are failing (Maybe not needed anymore since now they seem to work out)?

Maybe an other question about the review process. Should we have exactly one commit for this PR all the time or would you rather have us do multiple commits such that you see what we actually changed during the review process? Before finally merging we could still squash all the commits.

Kind regards
David & Benjamin

@pedroigor

Copy link
Copy Markdown
Contributor

@benjamin37 Thanks for the latest changes.

Cross-DC tests are unstable, so don't worry about it. But I'm going to check how the clustering ones (single dc) are doing.

Regarding squashing commits, whatever you prefer. I like to go over the files again though, it helps me to understand more about the changes as well as catching anything I missed before :)

@stianst

stianst commented Jul 24, 2020

Copy link
Copy Markdown
Contributor

Haven't looked at this, and hoping @pedroigor can do so soon.
With regards to "Why should we deprecate the old logout endpoint? The current GET logout will stay as it is, right?" - do you mean the RP initiated logout endpoint? There are improvements/changes we need to do there, but that is a separate issue to backchannel logout.

Hey @stianst,

yes in the Ticket: https://issues.redhat.com/browse/KEYCLOAK-2940?_sscc=t there it is written down that we should mark the old logout endpoint as deprecated. We asked ourselves if we should deprecate the old logout endpoint in our contribution and integrate the existing @get part into our new LogoutEndpoint or if we should leave it as it is so our contribution doesn't get to extensive.

Greetings David

You can ignore updating the logout endpoint as part of this, we'll handle that as a separate issue. Take a look at https://issues.redhat.com/browse/KEYCLOAK-11603 for more details

@pedroigor

Copy link
Copy Markdown
Contributor

@benjamin37 Only a few last comments.

Also, it would be nice if we could have a better response to a backchannel logout when logout was not successful for some clients. Like a JSON listing the clients that were not successful, or something like that. But I think this is an improvement and not a blocker.

@pedroigor pedroigor added status/in-review area/oidc OpenID Connect / OAuth 2.0 — tokens, endpoints, scopes, DCR, PAR, DPoP kind/enhancement Categorizes a PR related to an enhancement priority/important Must be worked on very soon labels Jul 28, 2020
@pedroigor

Copy link
Copy Markdown
Contributor

@DaSmoo Need a rebase. Please, let me know when you have the updates we discussed.

@benjamin37

Copy link
Copy Markdown
Contributor

Hi @pedroigor,

sorry for the delay. We'll provide the updates and the rebase tomorrow.

@benjamin37
benjamin37 force-pushed the KEYCLOAK-2940-back-channel-logout branch from e9c3444 to 626c753 Compare August 5, 2020 10:03
@benjamin37

Copy link
Copy Markdown
Contributor

Hi @pedroigor,

we updated the PR. We'll also provide tests for downstream logouts, hope I can finish these ones today (or at least this week).

@pedroigor

Copy link
Copy Markdown
Contributor

@DaSmoo Np. Latest changes look good.

@benjamin37

Copy link
Copy Markdown
Contributor

Hi @pedroigor,

we added the tests for downstream logouts, you can have an other look.

pedroigor
pedroigor previously approved these changes Aug 6, 2020

@pedroigor pedroigor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@DaSmoo Thanks.

@pedroigor

pedroigor commented Aug 6, 2020 •

Copy link
Copy Markdown
Contributor

@DaSmoo Could you rebase, please? Just noticed, after approving, that there are conflicts.

@benjamin37

Copy link
Copy Markdown
Contributor

@pedroigor sure, I'll rebase again

@pedroigor

Copy link
Copy Markdown
Contributor

@benjamin37 Forgot about something ... Could you also add this pedroigor@24e31b9 to your change set ?

I know it is not something you did, but we should fix that part so that we can release connection properly.

benjamin37 and others added 8 commits August 6, 2020 14:21
…onfigured

<!---
Please read https://github.com/keycloak/keycloak/blob/master/CONTRIBUTING.md and follow these guidelines when contributing to Keycloak
-->
…ogoutEndpoint

<!---
Please read https://github.com/keycloak/keycloak/blob/master/CONTRIBUTING.md and follow these guidelines when contributing to Keycloak
-->

reorganized the backchannel endpoint to the current logoutEndpoint
…ogoutEndpoint

<!---
Please read https://github.com/keycloak/keycloak/blob/master/CONTRIBUTING.md and follow these guidelines when contributing to Keycloak
-->

reorganized the backchannel endpoint to the current logoutEndpoint
<!---
Please read https://github.com/keycloak/keycloak/blob/master/CONTRIBUTING.md and follow these guidelines when contributing to Keycloak
-->

added Response as return type from the backchannel logout
@benjamin37

Copy link
Copy Markdown
Contributor

@pedroigor did the rebase and integrated the changes of commit pedroigor@24e31b9

@pedroigor

Copy link
Copy Markdown
Contributor

@benjamin37 Tks. Once CI finishes I'll merge.

@benjamin37

Copy link
Copy Markdown
Contributor

Hi @pedroigor,

just wanted to ask if there is anything else we should do that' blocking the merge?

@pedroigor
pedroigor merged commit ddc2c25 into keycloak:master Aug 12, 2020
@pedroigor

Copy link
Copy Markdown
Contributor

@benjamin37 Merged, thanks !

return client.execute(post);
}

public CloseableHttpResponse doBackchannelLogout(String logoutTokon) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There is a typo here. It was meant to be logoutToken instead of logoutTokon.

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

Labels

area/oidc OpenID Connect / OAuth 2.0 — tokens, endpoints, scopes, DCR, PAR, DPoP kind/enhancement Categorizes a PR related to an enhancement priority/important Must be worked on very soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants