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

allow extra config for a custom user federation implementation #134

Merged

Conversation

tomrutsaert
Copy link
Contributor

allow extra config for a custom user federation implementation.

I had some troubles writing a good test, as keycloak only returns custom config keys and values that the custom implementation understands. I used the written tests on a keycloak installation with my custom user federation spi, and everything worked as expected.
Any suggestions how to make better tests for this type of configuration?

@mrparkers
Copy link
Contributor

Yeah this is tricky. In its current state, anyone else who runs the tests locally (using the built user federation provider example) will see this test fail, since the example doesn't have any config properties.

If you'd like to put in the effort, it would be great if you could update the example provider to include some dummy config value. It looks like it doesn't have to be used, it just has to exist in order for the test to do what you want it to.

Otherwise, you can remove the test. This isn't running in CI anyways so I don't feel too bad about missing that test.

@tomrutsaert
Copy link
Contributor Author

Yeah this is tricky. In its current state, anyone else who runs the tests locally (using the built user federation provider example) will see this test fail, since the example doesn't have any config properties.

If you'd like to put in the effort, it would be great if you could update the example provider to include some dummy config value. It looks like it doesn't have to be used, it just has to exist in order for the test to do what you want it to.

Otherwise, you can remove the test. This isn't running in CI anyways so I don't feel too bad about missing that test.

I have extended the custom-user-federation-example to have a dummyConfig key.
My test is using that dummyConfig key, and everything works as expected.

People who want the run the tests locally, will of course need to rebuild the custom-user-federation-example with ./gradlew shadowJar

Copy link
Contributor

@mrparkers mrparkers left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution and for modifying the user federation example! Hopefully my kotlin code wasn't too bad to work with 😄

@mrparkers mrparkers merged commit 3e8a3e6 into keycloak:master Jul 17, 2019
@tomrutsaert tomrutsaert deleted the custom_config_for_custom_user_federation branch July 17, 2019 14:27
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.

2 participants