Cannot add user to Jenkins (Hudson) - jenkins

I installed stand alone Jenkins installer.
It is available on localhost:8080.
But I cannot understand how to add new account to it.
I tried "Configure Jenkinks" -> "enable security" and etc. from
https://wiki.jenkins-ci.org/display/JENKINS/Standard+Security+Setup
But I stil cannot find where exactly I should type username and password for new account.
This is instruction from wiki:
Click "login" link at the top right portion of the page
Choose "create an account"
There is no "create an account" button. I didn't find this button anywhere!
Where this form is located?

While you enabled security select Jenkins’s own user database under Access Control, mark Allow users to sign up. restart jenkins, you will get sign up option through which you can add users.

Assuming you just installed Jenkins and you're logged in as "admin", you have to click on "Manage Jenkins", then "Manage Users"

Related

How to set role-based login for jenkins in keycloak

I am very beginner of keycloak. I need some help.
I have SSO solution and I want to integrate it with jenkins.
In this point, I want to permit some users based role.
OpenID -- keycloak -- jenkins : all users who are in openid can login jenkins (I don't want)
OpenID -- keycloak (check role) -- jenkins : all users who are in openid and also have specific role in keycloak can login jenkins (I want)
I think this is very simple and common example of using keycloak, but I can't find the solution.
steps I did are here.
install keycloak plugin in jenkins.
install keycloak (version 5.0.0 using helm)
create realm
create Identity Providers (OpenID)
create client (named jenkins)
Installation tab > copy Keycloak OIDC JSON to Jenkins
(refer. https://wiki.jenkins.io/display/JENKINS/keycloak-plugin)
now, I can login jenkins successfully.
create role in Roles in realm
In (jenkins) client, turn on Authorization Enabled
Authorization tab > Policies tab > Create Policy > role
select realm role and check required
update JSON in Jenkins config.
It's done, but it does not works.
I managed it the following way (Using Keycloak 8.0.1, Jenkins 2.208):
Keycloak:
create realm
create client "jenkins" - set root url to Jenkins-url (e.g. http://127.0.0.1:8080)
In client "jenkins" select tab "installation" - format "keycloak OIDC JSON" - copy to clipboard for Jenkins Setup below
create role "jenkins_admin"
create role "jenkins_readonly"
create user "admin" and assign role "jenkins_admin"
create named user and assign role "jenkins_readonly"
Jenkins
verify that you have the necessary plugins installed (if not, install them):
"Keycloak Authentication Plugin"
"Matrix Authorization Strategy Plugin"
"Role-based Authorization Strategy plugin"
Switch authorization mode to Role-Based Strategy by going in "Configure Global Security" - Select "Authorization": "Role-Based Strategy" and then click on save
Add Keycloak authentication JSON by going to "Manage Jenkins" - "Configure System" - "Global Keycloak Settings" and paste the previously copied JSON (Keycloak step 3) to "Keycloak JSON" Area
Verify that an admin role is present by going to "Manage Jenkins" - "Manage and Assign Roles" - "Manage Roles" - "Global Roles". If not present, add the role "admin" with all checkboxes selected; then click on SAVE
Add a "read_only" role by going to "Manage Jenkins" - "Manage and Assign Roles" - "Manage Roles" - "Global Roles" and add role "read_only" with "Overall Read" selected; then click on SAVE
Create group "jenkins_admin" and assign to "admin" role by going to "Manage Jenkins" - "Manage and Assign Roles" - "Assign Roles" and add group "jenkins_admin" to global roles; then select "admin" and click on SAVE
Create group "jenkins_readonly" and assign to "read_only" role by going to "Manage Jenkins" - "Manage and Assign Roles" - "Assign Roles" and add group "jenkins_readonly" to global roles; then select "read_only" and click on SAVE
Change the "Security Realm" to Keycloak Authentication Plugin by going to "Configure Global Security" and selecting "Security Realm": "Keycloak Authentication Plugin", then click on save.
Logout
Now, when you try to perform a login, you should be redirected to the Keycloak login page.
Try to log in as admin with admin rights, and as named user with read only rights.
Besides answer of Christop :
you need to configure a Mapper for Group Membership under the keycloak client.
validate that by making sure that "groups" comes in the scope of access token.
Another point, you can use one of two plugins :
Either keycloak plugin
Or oic-auth plugin (open id connect) indeed, keycloak implements the openid connect protocol at the end.
Last point :
make configuration-as-code an essential plugin in your jenkins stack.
Check always examples in configuration-as-code plugin, it might help a lot. For this case, these links can help a lot :
https://github.com/jenkinsci/oic-auth-plugin/pull/78/files
https://github.com/jenkinsci/configuration-as-code-plugin/issues/994#issuecomment-523643362

Jenkins (not admin) Users Password reset/Username change

I just added the Security to Jenkins.
Jenkins’ own user database enabled
Matrix based security configured
Now i'm configuring and installing the Role matrix plugin.
In case someone want to change his password he just have to login, click on this user configuration and change his password, what if they forgot their password or if I want to change their username?
What is the standard procedure to follow bt the administrator in order to reset change his password, or at least delete and recreate the user?
What if the admin want to change a username? is there any standard way to do it?
Thanks
If you are the admin you can change password of any user through
'People' --> 'Select_any_user_listed' --> 'Configure' --> 'Password'
Just erase the old password and write a new one there.
if you want to delete a user go to:
'Manage Jenkins' --> 'Manage Users' --> 'press the red button corresponding to the user'
or go to this url:
http://<jenkins.url>/user/<username>/delete

How to setup authentication on jenkins

I installed jenkins on a CentOS system. Now I am able to open the jenkins web page on localhost:8080. I want to add a login required for accessing this url. I enabled security on 'Configure Global Security' page then set 'Unix user/group database' under 'Security Realm'. In Authorization part, I set 'Logged-in users can do anything'. By doing this configuration, only logged in user can do build and modification on jobs. But there is a problem that users can still read all the jobs information without log in. How can I prevent anonymous users to access my jenkins web page?
Using the "Matrix based security" helps you here. And then uncheck all the checkboxes from the Anonymous user.
Under the "Jenkins’ own user database" also uncheck the "Allow users to sign up" sign up option. This way you can prevent unwanted users.
Good luck!

bitbucket remove one user's write access

I grant a friend with write access to my project on bitbucket.
But now, he wants to quit but want to remain a read access to view how I'm going with my codes.
I looked through some pages I googled, but didn't find how to change his access from 'write' to 'read'.
Please tell me how I should do this.
The link above is now dead, so at present you can edit user groups by clicking on your profile image at the top right then Bitbucket Settings, select your team from the dropdown next to the word "Settings" on the left, then click "User Groups" under Access Management on the left-hand menu.

Add Users to Jenkins with "Allow users to sign up" Disabled

I do not want new users to be able to sign up. So in Jenkin's Configuration, I disabled "Allow users to sign up" with using Jenkin's own user database.
But how can I manually add users now?
Also, is there a default admin user I should take care of?
There is "Create Users" in "Manage Jenkins".
In case "Allow users to sign up" was already disabled and security turned on and there is no user you can use to login the only way to go is to change Jenkins configuration manually on the server and restart server.
Thing to change is in Jenkins Home folder i config.xml file.
change
<useSecurity>true</useSecurity>
to
<useSecurity>false</useSecurity>
restart and refresh browser
Voila!!!
Manage Jenkins -> Jenkins own user database, Anyone can do anything. Then you are not forced to login or signup. Manage Jenkins -> Manage Users and you create your users, then setup security accordingly.
If you don't setup the security method first there is no way to add users.
A convenient way for configuring Jenkins is to edit the config.xml file directly and use the Manage Jenkins -> Reload configuration from Disk hyperlink instead of restarting the service.
The recommended way to handle this is to use matrix based security and leave sign up on. Set default permissions to nothing, this way when people sign up they can't actually do anything until you explicitly grant them permissions. If you don't want to leave the sign up on for some reason, you will have to enable to add users and then disable when you are done. As far as I know there is no way to add a user with sign up turned off unless you want to hand edit the config files.
There is no default admin user, you will want to make sure you add yourself with max permissions or you risk getting locked out when you enable security.

Resources