User Roles
Understand user accounts, the three roles (viewer, manager, admin), authentication, single sign-on and session security in AsPeekIt.
User Accounts
A user account is a person who signs in to the AsPeekIt web application. Users sign in with their username and password (plus a two-factor code when it is enabled) and receive a JWT token pair that grants access to the UI and the API. User accounts are separate from operator records: operators are contact entries used for asset ownership, while user accounts control authentication and access. Integrations should use scoped API tokens (/docs/api/api-tokens) instead of a personal account.
User Profile Fields
Each user account stores profile information that the user can update from the Settings page (/docs/getting-started/settings).
- Username: the login name (set when the account is created)
- Email: must be unique among the users
- First name, last name, job title, department and phone
- Role: viewer, manager or admin (read-only for the user, changed by an admin)
- Preferences: theme, accent, density and the Dashboard layout, saved on the server (/docs/getting-started/user-preferences)
Roles
Every user has exactly one role; new accounts are viewers unless an admin chooses otherwise. Roles are cumulative: a manager can do everything a viewer can, an admin everything a manager can. The API enforces them on every request (403 otherwise); the UI hides the actions and pages a role cannot use.
- Viewer: reads the inventory, topology, services, monitoring, security findings and the other pages, edits their own profile and notification preferences, and comments on findings
- Manager: also creates and edits zones, environments, agents and relays (Zones, Environments, Agents and Relays appear in the sidebar), teams and operators, asset ownership and business context, business services and dependencies; triages findings (acknowledge, resolve, false positive, reopen, assign, accept risk, bulk actions) and manages suppression rules; classifies container images, imports SBOMs and generates the executive report
- Admin: also manages users (User Management), API tokens, the audit log, notification channels, vulnerability feeds and asset type definitions

Changing a Role
Admins change roles and activate or deactivate accounts in User Management (/docs/teams/user-management). A role or status change revokes the user's refresh tokens, so they must sign in again. The last active admin can never be demoted or deactivated.
OIDC Single Sign-On
The API can exchange an ID token from an external identity provider for an AsPeekIt token pair: POST /api/v1/auth/oidc/exchange/ with {"provider": "azure-ad" | "google" | "okta", "token": "<id_token>"}. A provider is enabled only when its settings are present (AZURE_AD_CLIENT_ID and AZURE_AD_TENANT_ID, GOOGLE_CLIENT_ID, OKTA_CLIENT_ID and OKTA_ISSUER); without any, the endpoint answers 404. The token signature is verified against the provider keys, and the issuer and audience are checked before any claim is used.
- Account linking: users are linked by the immutable provider subject (Azure AD oid, otherwise sub); an existing account with the same email is linked only when the provider asserts the email is verified
- Automatic provisioning: a new user is created on first login from the email, given name, family name and preferred username claims
- Group mapping (Azure AD and Okta): members of OIDC_ADMIN_GROUP (default IDP-Admin) become admins, of OIDC_STAFF_GROUP (default IDP-Staff) managers, everyone else viewers, at every login; for Google the role is managed in AsPeekIt by an admin
- A disabled account is refused (403)
Note: The login page of the web application signs in with username and password; the OIDC exchange is an API endpoint for an SSO front end.
Session Security
AsPeekIt uses JSON Web Tokens (JWT) for stateless sessions, built on SimpleJWT with rotation and blacklisting.
- Access token: valid for 1 hour, sent with every API request in the Authorization header
- Refresh token: valid for 7 days, used to obtain a new access token
- Rotation: each use of a refresh token issues a new one and blacklists the old one
- Revocation: changing the password, the role or the active status revokes the outstanding tokens of the user
- Two-factor authentication: TOTP codes cannot be replayed and backup codes are single-use; login attempts are throttled per client and per username
Warning: A stolen refresh token can mint new access tokens until it expires or is rotated. Enable two-factor authentication, and change the password to revoke every session of an account.