Skip to content
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

feat: add required scopes configuration property to openid-connect plugin #10493

Merged

Conversation

csotiriou
Copy link
Contributor

Fixes #10352

This adds the optional required_scopes configuration property in the openid-connect plugin configuration. In cases where the introspection endpoint of the OIDC server is called, the plugin will check if all required scopes are present in the scopes returned by the introspection endpoint.

I have also updated the documentation to reflect this, in case anyone finds this PR valuable.

@moonming
Copy link
Member

@csotiriou thanks for this PR. It will be great if you can add test cases for it :)

@csotiriou
Copy link
Contributor Author

Hello @moonming I'm trying to wrap my head around the test implementation, my familiarity with lua is limited. However, I have reached the point where I'm making a sample test.

I noticed that for the openid-connect plugin there are some sample oidc providers with a dummy client-id and client-secret used. Must I use the same and have the same configuration in my keycloak? If not, how are tests going to pass during automation?

@moonming
Copy link
Member

@Revolyssup Please check how to write a more appropriate test case. I am not familiar with this plug-in.

@Revolyssup Revolyssup self-requested a review November 16, 2023 18:24
@Revolyssup Revolyssup self-assigned this Nov 16, 2023
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
@Revolyssup
Copy link
Contributor

Revolyssup commented Nov 16, 2023

@moonming @csotiriou I have added the test case and fixed the lint tests to save time.

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
moonming
moonming previously approved these changes Nov 17, 2023
@moonming
Copy link
Member

@csotiriou thanks for your great work 👍

@soulbird
Copy link
Contributor

I think you need to add a test case for scope validation

@Revolyssup
Copy link
Contributor

I think you need to add a test case for scope validation

@soulbird Do you mean the case where the correct scope is passed and the request succeeds?

@moonming
Copy link
Member

Conflicting files
docs/en/latest/plugins/openid-connect.md

@csotiriou please fix this when you have time.

Signed-off-by: Ashish Tiwari <ashishjaitiwari15112000@gmail.com>
@soulbird
Copy link
Contributor

I think you need to add a test case for scope validation

@soulbird Do you mean the case where the correct scope is passed and the request succeeds?

yes

@csotiriou
Copy link
Contributor Author

csotiriou commented Nov 20, 2023

Conflicting files
docs/en/latest/plugins/openid-connect.md

@csotiriou please fix this when you have time.

Thanks for the notification, @moonming , It seems that the merge conflicts in the conflicting documentation files have been resolved by @Revolyssup faster, thank you for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants