-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Enhancing Lightweight access token M2 #25716
Conversation
de3489e
to
cc0ba88
Compare
cc0ba88
to
39e9ea7
Compare
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.
@skabano This looks great to me, Thanks!
I've added one minor comment inline. Could you please check it?
@tnorimat Could you please review as well?
Besides that, we will likely need some documentation? I wonder if it is ok to add documentation for Lightweight access tokens in this PR or use it in the follow-up PR? Whatever of those is fine with me.
For the documentation, I suggest to:
- Add some small paragraph in the https://www.keycloak.org/docs/latest/server_admin/index.html#_protocol-mappers about lightweight access tokens and how to use them (together with the executors). It can be also nice to redo the screenshots in this section due the new configuration switches "Add to introspection" and "Add to lightweight token", which you added.
- Also it can be nice to list the executor here where all the other executors are: https://www.keycloak.org/docs/latest/server_admin/index.html#executor . Possibly with the link to the new lightweight tokens section.
@skabano @tnorimat WDYT? Do you prefer follow-up PR for the documentation or do it directly in this one?
server-spi-private/src/main/java/org/keycloak/models/ClientPolicyConstants.java
Outdated
Show resolved
Hide resolved
1 flaky test on run #10453 ↗︎
Details:
cypress/e2e/masthead_test.spec.ts • 1 flaky test • chrome
Review all test suite changes for PR #25716 ↗︎ |
39e9ea7
to
2075c13
Compare
@mposolda Yes, I will review the PR. |
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.
@skabano I added some review comments. Could you check them?
String introspectResponse = oauth.introspectAccessTokenWithClientCredential(RESOURCE_SERVER_CLIENT_ID, RESOURCE_SERVER_CLIENT_PASSWORD, accessToken); | ||
System.out.println("tokenResponse:" introspectResponse); | ||
assertTokenIntrospectionResponse(JsonSerialization.readValue(introspectResponse, AccessToken.class), true, true, false); | ||
|
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.
How about adding a test here to check whether a client get an access token instead of a lightweight access token after removing a policy to apply UseLightweightAccessTokenExecutor
to the client?
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.
Added test.
OAuthClient.AccessTokenResponse tokenResponse = oauth.doAccessTokenRequest(authsEndpointResponse.getCode(), TEST_CLIENT_SECRET); | ||
String accessToken = tokenResponse.getAccessToken(); | ||
assertAccessToken(oauth.verifyToken(accessToken), true, false); | ||
System.out.println("access token:" accessToken); |
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.
How about replacing System.out.println
with other logging method? It seems that Keycloak tends not to use System.out.println
. Could you check other lines using System.out.println
in this test class?
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.
Changed to use logger.debug.
2075c13
to
1aa310c
Compare
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.
@skabano I added one review comment. Could you check it?
@@ -1,6 1,7 @@ | |||
package org.keycloak.testsuite.oidc; |
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.
Could you add header comments?
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.
Added header.
1aa310c
to
f12c172
Compare
@skabano
to
|
f12c172
to
6fa74a8
Compare
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.
LGTM
@mposolda Could you check the PR? |
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.
@skabano There are some conflicts, could you please resolve them? Hopefully just rebase would help. Thanks! |
Closes keycloak#23724 Signed-off-by: shigeyuki kabano <[email protected]>
6fa74a8
to
c27d29d
Compare
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.
@skabano Thanks!
Closes keycloak#23724 Signed-off-by: shigeyuki kabano <[email protected]> Signed-off-by: Stefan Wiedemann <[email protected]>
Closes keycloak#23724 Signed-off-by: shigeyuki kabano <[email protected]> Signed-off-by: ShefeeqPM <86718986 [email protected]>
Lightweight access token support follows milestone #21186.
Since M0,1 have already been implemented, I will implement milestone 2.
Details of the M2 specification can be found in #23724.
closes #23724