jenkinsci / cas-plugin

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

Groovy script to configure CAS #11

Closed db0 closed 3 years ago

db0 commented 3 years ago

This is a bit of an support request, but I'm hoping you could assist.

At the moment,in another Jenkins instance I'm using a groovy script similar to this to configure LDAP authentication. I was wondering if you could provide something similar for configuring CAS as well.

If not, no worries, I'll make-do with inserting the XML directly into the jenkins config, but I think a groovy script would be more appropriate.

Thanks in advance

fcrespel commented 3 years ago

I've never tried configuring Jenkins with a Groovy script, but judging by the example you linked to, you should be able to create a new CasSecurityRealm(params...) instead of the LDAPSecurityRealm. Refer to the CasSecurityRealm.java file and protocols (e.g. Cas30Protocol.java) to see which parameters to use.

db0 commented 3 years ago

Perfect. That will help. I didnt know what to look for. I should be able to figure the rest on my own. Thanks!