Symptoms:
- How to use UVCS(Plastic SCM) Plugins in Jenkins without expiring tokens?
- How to use Server Rest API with Unity SSO?
Resolution:
How to Generate an API Key
- Visit plastiscm.com
- Scroll down and visit the Plastic SCM dashboard
- Click Edit Profile on the left navigation
- Scroll down and Locate API Keys
- Click Add New API Keys
- The generated API Key can be used as a replacement for accessToken in the Server REST API or as a token for Jenkins.
How to use the generated API Key with Server REST API
- Since you already generated API Keys, you do not need to call the login API, and the token generated from the API key can be used as an access token.
- To use the Server REST API, the user will need to retrieve the access token by using the login API.
How to use the generated API Key with Jenkins
Note: the instructions below are for persistent agents. The file needs to be present in the agent to run the jobs
- Configure working mode "Use system configuration"
- Locate the cm.exe that Jenkins uses(it can be under the Jenkins directory or where the standalone is located)
- Open Terminal/CMD in the directory where cm.exe is that Jenkins uses, and run the command below with your own information
cm profile create --server=<yourorg>@cloud --username=<yourusername> --token=<youraccesstoken> --workingmode=SSOWorkingMode
- The tokens.conf and profiles.conf will be generated in the following path:
Windows path: %localappdata%\plastic4\ Mac/Linux path: $HOME/.plastic4/
- Then move the generated files(tokens.conf and profiles.conf) to cm.exe, which Jenkins uses