Authorization tokens can be created by users and administrators to provide fine-grained access control to resources (channels) or scopes when using the API or CLI. These tokens can be used in place of username-based authentication, particularly for third-party applications or automation tools.

This topic provides guidance on the following actions:

Understanding tokens

Scope-based

Scope-based tokens give the token holder permission to take specific actions. It is possible to create private tokens with a specific set of scopes.

Resource-based

Resource-based tokens provide access to specific resources. Channel group permissions granted by the token will determine what actions the user is allowed to take.

Understanding scopes

In our model, scopes are represented as a concatenated string, like so:

Resource:Action

Some features in the table below may contain “(by user with manage permissions)”, like in the feature associated with channel:edit in the third row down, for example. This means the token has a role with a corresponding permission level (in this case, manage) for a specific resource (in this case, channel).

ResourceActionScope (Resource + Action)FeatureDefault Roles
channelcreatechannel:createCreate a channel (at least by authenticated user)author, admin
viewchannel:viewView a channel (public)everyone, author, admin
editchannel:editEdit a channel information (by user with manage permissions)admin
deletechannel:deleteDelete a channel (by user with manage permission)admin
historychannel:historySee channel history (by user with manage permissions)admin
view-artifactschannel:view-artifactsView channel artifacts (public)everyone, author, admin
channel.default-channeleditchannel.default-channel:editEdit default channel (user with manage permissions)admin
channel.groupeditchannel.group:editEdit channel group (user with manage permissions)admin
channel.mirrorviewchannel.mirror:viewView channel mirror configurationadmin-only
editchannel.mirror:editEdit channel mirror configurationadmin-only
subchannelcreatesubchannel:createCreate subchannel (user with write permission) to the parent channeladmin
viewsubchannel:viewView subchannel (public)everyone, author, admin
editsubchannel:editEdit subchannel information (user with manage permission)admin
deletesubchannel:deleteEdit subchannel information (user with manage permission)admin
historysubchannel:historyView subchannel history (user with manage permission)admin
view-artifactssubchannel:view-artifactsView subchannel artifacts (public)everyone, author, admin
subchannel.groupeditsubchannel.group:editView subchannel groups (user with manage permissions)admin*
subchannel.mirrorviewsubchannel.mirror:viewView subchannel mirror configurationadmin-only
editsubchannel.mirror:editEdit subchannel mirror configurationadmin-only
artifactcreateartifact:createUpload artifact (user with write permission to parent resource which is channel or subchannel)author, admin
viewartifact:viewView artifact (public)everyone author, admin
editartifact:editEdit artifact (user with manage permission to parent resource)author, admin
downloadartifact:downloadDownload artifact (public)everyone author, admin
deleteartifact:deleteDelete artifact (user with manage permission to parent resource)author, admin
cveviewcve:viewView CVEadmin-only
roleviewrole:viewView custom rolesadmin-only
editrole:editEdit custom rolesadmin-only
system.licenseview, editsystem.license:view system.license:editView / Edit licenses
system.blobs ?deletesystem.blobs:deleteDelete orphan blobs
systemView system history
systemView system stats

Italicized items in table are under development.

Listing the available authorization scopes

Via the API:

GET /api/system/tokens

Via the CLI:

conda repo auth --list-scopes

Listing the user authorization tokens

Via the API:

GET /api/account/token

Via the CLI:

conda repo auth --list

Create a new user authorization token

Via the API:

POST /api/account/tokens

Via the CLI:

conda repo auth --create -n <NAME>

Removing a user authorization token

Via the API:

DELETE /api/account/tokens/<TOKEN_ID>

Via the CLI:

conda repo auth --remove <TOKEN_ID>

Was this page helpful?