This plugin incorporates SSO in Jenkins with Casdoor
TODO
You can refer to Casdoor Official Doc.
The following are some of the names in the configuration:
CASDOOR_HOSTNAME
: Domain name or IP where Casdoor server is deployed.
JENKINS_HOSTNAME
: Domain name or IP where Jenkins is deployed.
Firstly, the Casdoor and Jenkins should be deployed.
After a successful deployment, you need to ensure:
- Set Jenkins URL(Manage Jenkins -> Configure System -> Jenkins Location) to
JENKINS_HOSTNAME
. - Casdoor can be logged in and used normally.
- Set Casdoor's
origin
value (conf/app.conf) toCASDOOR_HOSTNAME
.
- Create or use an existing Casdoor application.
- Add a redirect url:
http://JENKINS_HOSTNAME/securityRealm/finishLogin
- Add provider you want and supplement other settings.
Not surprisingly, you can get two values on the application settings page: Client ID
and Client secret
like the picture above, we will use them in next step.
Open your favorite browser and visit: http://CASDOOR_HOSTNAME
/.well-known/openid-configuration, you will see the OIDC configure of Casdoor.
Now, you can install Casdoor plugin from the market or by uploading its jar
file.
After completing the installation, go to Manage Jenkins -> Configure Global Security.
Suggestion: Back up the Jenkins config.xml
file, and use it to recover in case of setup errors.
- In Security Realm, select "Casdoor Authentication Plugin".
- In Casdoor Endpoint, specify the
CASDOOR_HOSTNAME
noted above. - In Client ID, specify the
Client ID
noted above. - In Client secret, specify the
Client secret
noted above. - In JWT Public Key, specify the public key used to validate JWT token. You can find the public key in Casdoor by clicking
Cert
at the top. After clickingedit
your application, you can copy your public key in the following page. - Organization Name and Application Name is optional. You can specify your organization and application to verify users in other organizations and applications. If they are empty, the plugin will use the default organization and application.
- In the Authorization section, check “Logged-in users can do anything”. Disable “Allow anonymous read access”.
- Click
save
.
Now, Jenkins will automatically redirect you to Casdoor for authentication.