jenkinsci / cas-plugin

Jenkins CAS Plugin
https://plugins.jenkins.io/cas-plugin/
MIT License
9 stars 16 forks source link

Extra parameters to the validation url #6

Closed db0 closed 3 years ago

db0 commented 3 years ago

My CAS provider is requesting that I pass some extra parameters in the validation url (e.g. "?groups=internet"). Is there any possible way to do that using this plugin? I have root access to the jenkins systems so I can customize or reconfigure anything as needed.

I tried putting it in CAS Server URL variable, but from the logs I see that it didn't construct correctly.

db0 commented 3 years ago

As far as I can see, it is possible to pass custom parameters to the validation URL. I just need an interface to enter them. Unfortunately my java knowledge is pretty much non-existent so I cannot compile a pull request :(

fcrespel commented 3 years ago

Right now this plugin doesn't allow you to customize validation URL parameters, but it should be fairly straight-forward to implement. I'll give it a try and let you know.

fcrespel commented 3 years ago

A test build is available here, to install it you can go to the Advanced tab of the Plugins page and upload it there. Then in the Security Realm config, click Advanced next to the Protocol selection and you'll find a textbox to specify "Custom validation URL parameters", i.e. groups=internet

Let me know if this works for you :-)

db0 commented 3 years ago

Awesome! I will definitely try it out tomorrow first thing. Thanks so much for this fast response

db0 commented 3 years ago

This works great, but it seems to have broken the JSON request. Now it always returns XML, because it seems the &format=JSON is never added to the validation URL.

fcrespel commented 3 years ago

Thanks for the feedback, here is a new test build that should fix this particular issue.

db0 commented 3 years ago

This works! Brilliant. Thank you so much again!

fcrespel commented 3 years ago

CAS plugin version 1.6.0 is now released and includes this improvement.