-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Support token relay clientRegistrationId on properties #3751
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
base: main
Are you sure you want to change the base?
Support token relay clientRegistrationId on properties #3751
Conversation
// The filter extracts an OAuth2 access token from the currently authenticated user for the provided `clientRegistrationId`. | ||
// If no `clientRegistrationId` is provided, | ||
The currently authenticated user's own access token (obtained during login) is used and the extracted access token is placed in a request header for the downstream requests. | ||
The filter extracts an OAuth2 access token from the currently authenticated user for the provided `clientRegistrationId`. |
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.
Just to be clear this functionality was already present but the documentation for it was commented out?
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.
It's not just the documentation. It seems that, this feature was included as part of the initial filter BUT, is not working. With this PR i'm reenabling the TokenRealy filter through properties, and uncomment the related documentation.
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 a test to confirm it is now working?
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.
I'm sorry, but i don't see an example to test filter functions through properties in gateway-server-mvc to take as base, and my knowledge is limited at this point.
A manual test with properties like these:
spring:
cloud:
gateway:
mvc:
routes:
- id: token_relay_test
uri: https://examplel1.com
filters:
- TokenRelay=relay
security:
oauth2:
client:
provider:
relay:
jwk-set-uri: https://localhost:8080/context/path/jwk
issuer-uri: https://localhost:8080/context/path/issuer
registration:
relay:
provider: relay
client-authentication-method: client_secret_post
authorization-grant-type: client_credentials
client-id: someClientId
client-secret: someClientSecret
works perfectly using it in a complete spring boot application.
If someone could create a specific test for this, I would be grateful.
Could you please sign your commit so the DCO check will pass? |
Signed-off-by: Jaime Sánchez <[email protected]>
441e920
to
3bc2267
Compare
Support token relay clientRegistrationId on properties
The current code supports clientRegistrationId via Java filter.
Just added Shorcut annotation and update docs.
Thank you