8000 [KEYCLOAK-5071] If refresh token failed, drop token in security context by wvdhaute · Pull Request #4235 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

[KEYCLOAK-5071] If refresh token failed, drop token in security context - #4235

Closed
wvdhaute wants to merge 1 commit into
keycloak:masterfrom
wvdhaute:expired-refresh-token
Closed

wvdhaute wants to merge 1 commit into
keycloak:masterfrom
wvdhaute:expired-refresh-token

Conversation

@wvdhaute
Copy link
Copy Markdown
Contributor

No description provided.

@mposolda
mposolda commented Jul 3, 2017
Copy link
Copy Markdown
Contributor

@wvdhaute It looks there is a test failure in CookieTokenStoreAdapterTest.testTokenInCookieRefresh . Seems it's related to your PR. Could you verify please?

@mposolda
Copy link
Copy Markdown
Contributor

@wvdhaute Sorry for late response. I was on PTO, but finally back now.

In your PR I can see that you changed line 159 in CookieTokenStoreAdapterTest and it looks to me that user is still logged now even if he should be logged-out. IMO the change in behaviour like this can't be accepted. Please investigate why this is the case, maybe some other changes need to be done to preserve the old behaviour.

@mposolda
Copy link
Copy Markdown
Contributor

@wvdhaute Also please squash commits into one commit. We prefer to have ideally 1 commit per PR. Thanks.

@wvdhaute
wvdhaute force-pushed the expired-refresh-token branch 2 times, most recently from 24e81a9 to f8cd9d9 Compare July 13, 2017 14:40
@wvdhaute
wvdhaute force-pushed the expired-refresh-token branch from f8cd9d9 to f70f9ad Compare July 14, 2017 06:20
@mposolda
Copy link
Copy Markdown
Contributor

@wvdhaute Thanks and sorry for late response.

Unfortunately the same change like in UndertowCookieTokenStore.java will likely need to be added to all our other adapters, which support CookieStore. EAP, Tomcat, Jetty and possibly more. We have some howto how to run adapter tests - they are not part of the default built, which is why this PR is passing, but I bet they will fail after this change. Howto is here: https://github.com/keycloak/keycloak/blob/master/testsuite/integration-arquillian/HOW-TO-RUN.md

The thing is that RefreshableKeycloakSecurityContext is the adapter-core class used in all the other adapters and every change in behaviour like this needs to touch all the other adapters.

@mposolda
Copy link
Copy Markdown
Contributor

BTV. RefreshableKeycloakSecurityContext wasn't mean to be class used in the end user's applications. Maybe it's easier if you just used your own fork (or subclass) of it instead of touch the core class?

@wvdhaute
wvdhaute commented Aug 2, 2017
Copy link
Copy Markdown
Contributor Author

@mposolda no problem, holiday period, same goes for me :)

Ok, I will try to find some time later on as I cannot run these tests easily on my work machine, port issues.

@stianst
stianst commented Oct 5, 2017
Copy link
Copy Markdown
Contributor

@mposolda can you review this again? It looks like @wvdhaute has done what was requested

@mposolda
Copy link
Copy Markdown
Contributor

@wvdhaute Were you able to run adapter tests with Wildfly, EAP, JBoss7 and Tomcat?

@wvdhaute
Copy link
Copy Markdown
Contributor Author

@mposolda sorry did not find time yet to run these and sort of forgot about it also to be honest. Also hard to run them on the company machine as we have a port issue. Hopefully I'll find some time this weekend. I'll bump it on my list :)

@mposolda
mposolda commented Nov 6, 2017
Copy link
Copy Markdown
Contributor

Closing this PR for now due the:

  • It's not complete and there is some work pending for a long time. Especially there is slight risk that the change will break some adapter impls.
  • It adds some improvements to RefreshableKeycloakSecurityContext class, but this class was originally meant to be used internally by our adapters, not as an util class for handling adapter flows manually from the client applications.

Feel free to reopen if you really think that this require fixing and if you have complete PR and all the adapter tests passing (including EAP6, AS7, Wildfly, EAP7, Spring, all Tomcat and all Jetty versions). However if you really want the customizations, it's maybe better and easier to rather create your own class (or subclass of RefreshableKeycloakSecurityContext) and do it by yourself in your own way.

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.

3 participants

0