.
Overview
This article demonstrates how to change an OKTA SAML User's username in the Sonatype Nexus Repository.
1.) Before making changes, ensure that you have successfully configured Okta SAML integration with the Sonatype Nexus Repository by following: Okta SAML integration with the Sonatype Platform
2.) If you need to change multiple users, test the process with a single user first. Additionally, please make a list of the original usernames, as they will be needed later.
Steps
1. Update OKTA configuration
Okta allows you to configure the "Application Username" during SAML integration.
You can change an OKTA user's username on the user's profile page:
However, the changed username won't be synced with the application automatically(Maybe OKTA has a job that can do this, but please consult the OKTA support team).
To update the username on the application side, there are two options:
1.1. Update an individual user's username
Applications->Applications->Click the application-> Go to the Assignments Tab->Find the user->Click edit icon
You can see the username here is still the original username.
You can manually change it or click "Reset"
1.2. Update Multiple users' usernames
You can follow the above method to update the user's application username one by one or
Go to Applications->Applications->Click the application-> Go to the Sign On tab-> Click the Update Now button in the below image.
2. Delete the Original SAML Users in the Sonatype Nexus Repository
After updating usernames in Okta, users will see their new usernames upon logging into Nexus Repository. However, the original usernames will still exist in the system. You must remove them manually.
2.1 Delete Users Via the Nexus UI
-
Log in to Nexus Repository as an admin user.
-
Navigate to Administration → Security → Users → Choose Source: SAML
-
Locate and delete the original users.
2.2 Delete Users via API
Alternatively, you can remove users using the Nexus API(Administration->System->API-> Security management: users->Delete), an example:
curl -u admin:admin123 -X 'DELETE' 'http://localhost:8081/service/rest/v1/security/users/afterchange%40example.com?realm=SamlRealm'
Ensure you include realm=SamlRealm
in the request.