Method 1: Creating a transient user with an access token

XRAY: How to restrict users only to access Xray through REST API without providing UI access

AuthorFullName__c
Shashwath Rai
articleNumber
000005513
ft:sourceType
Salesforce
FirstPublishedDate
2022-12-21T07:55:22Z
lastModifiedDate
2023-01-22T11:07:26Z
VersionNumber
2
We can create a transient user with an access token. The advantage of access tokens is the fact that you do not have to create a user in Artifactory to use them. When creating a token, you can specify a user name that does not exist in Artifactory, and Artifactory will create a transient user that will only exist as long as the token is valid(We can specify while creating an access token).

To create a Transient user go to Administration → Identity and Access → Access Tokens → Generate Token. Here you can specify the service to which the user can have access(if only to Xray REST API) and set the expiration time.

User-added image
Two ways to use access tokens for authentication. For example:

Basic Authentication
  curl -u<USERNAME>:<TOKEN> <Xray url>/xray/api/v2/watches

Authorization Headers
  curl -H"Authorization: Bearer <TOKEN>" <Xray url>/xray/api/v2/watches