Magistrala
User-guide

Personal Access Tokens

Manage access tokens and scopes securely

Overview

Personal access tokens are an alternative to using bearer tokens to perform various operations on the entities. To access personal access tokens (PATs) click on Personal Access Token tab on the user profile picture or avatar at the top right.

User Popover

Create a PAT

To create a PAT, click on the + Create PAT button.

Pat Table

This action redirects the user to the PAT creation page, where required details can be provided. The name should be a recognizable label for the token, and the duration sets the period for which the token will remain valid. Additionally, the user can enter an optional description and define scopes, which specify the operations the PAT is allowed to perform. Each PAT can be restricted to specific operations on particular entities, providing fine-grained access control.

Create Pat

Available scope entities are Clients, Channels, Groups, and Domain. Each entity type exposes a distinct set of operations:

Clients

OperationDescription
viewView a client
updateUpdate client information
update_tagsUpdate client tags
update_secretUpdate client secret/credentials
enableEnable a client
disableDisable a client
deleteDelete a client
set_parent_groupAssign a parent group to a client
remove_parent_groupRemove the parent group from a client
connect_to_channelConnect a client to a channel
disconnect_from_channelDisconnect a client from a channel

Channels

OperationDescription
viewView a channel
updateUpdate channel information
update_tagsUpdate channel tags
enableEnable a channel
disableDisable a channel
deleteDelete a channel
set_parent_groupAssign a parent group to a channel
remove_parent_groupRemove the parent group from a channel
connect_clientConnect a client to the channel
disconnect_clientDisconnect a client from the channel

Groups

OperationDescription
viewView a group
updateUpdate group information
update_tagsUpdate group tags
enableEnable a group
disableDisable a group
deleteDelete a group
retrieve_group_hierarchyRetrieve the group hierarchy
add_parent_groupAssign a parent group
remove_parent_groupRemove the parent group
add_children_groupsAdd child groups
remove_children_groupsRemove specific child groups
remove_all_children_groupsRemove all child groups
list_children_groupsList child groups
set_child_clientAssign a client as a child of the group
remove_child_clientRemove a client from the group
set_child_channelAssign a channel as a child of the group
remove_child_channelRemove a channel from the group

Domain

The Domain entity scope is automatically locked to the current domain.

OperationDescription
createCreate a new domain
updateUpdate domain information
readRead domain details
enableEnable the domain
disableDisable the domain
listList domains
send_invitationSend a domain invitation
list_invitationList invitations sent by the user
list_domain_invitationList all invitations for the domain
delete_invitationDelete a domain invitation
create_clientsCreate clients within the domain
list_clientsList clients in the domain
create_channelsCreate channels within the domain
list_channelsList channels in the domain
create_groupsCreate groups within the domain
list_groupsList groups in the domain

View a PAT

After a PAT is created, the user is redirected to the PAT detail page. Alternatively, the user can view an existing PAT by clicking on the row or the View button in the row actions.

Upon creation, the PAT secret is displayed once, allowing the user to copy it. This secret will not be shown again once the page is reloaded.

Pat Id

Manage scopes

Add a scope

To add a new scope to an existing PAT, the user can click the Add Scope button. This allows the user to define additional permissions for the token.

Add Scope

Delete a scope

The user can delete a specific scope from a PAT by clicking the trash icon in the scopes table. To remove all scopes associated with a PAT, the user can click the Delete All button.

Manage Scopes

Revoke a PAT

To revoke a PAT, click on the Revoke button located in the status row of the PAT detail page.
Once a PAT is revoked, it becomes inactive and can no longer be used to perform any of the scoped operations.

Revoke Pats

Regenerate a PAT

After revocation, the user can regenerate the PAT by clicking the Regenerate button. A dialog will appear, allowing the user to select a new validity duration. This creates a new secret while preserving all other PAT details such as the name, description, and scopes.

Regenerate Pat

Expired tokens can also be regenerated. To do this, the user should navigate to the PATs page and change the status filter to Expired to view all expired tokens.

Expired Pat

The user must then click on the expired PAT to view its details, and from there, click the Regenerate button. A dialog will appear, allowing the user to select a new duration. This process reactivates the PAT and generates a new secret, while maintaining the original configuration.

Delete a PAT

The user can delete an individual PAT by clicking Delete in the row actions.

Delete Pat

To remove all PATs, the user can click the Delete All button located on the PATs table.

On this page