OAuth applications
Register applications that act on behalf of UnitX users, understand the consent screen, and revoke access.
An OAuth application lets another piece of software act on behalf of a UnitX user — with their approval, in one organization, and only for the permissions it was registered for. The user never gives the application their password: they approve it on UnitX’s own consent screen.
When to use OAuth instead of an API key#
- Use an OAuth application when the software should act as the person using it — for example a browser extension or a tool your colleagues each sign in to.
- Use a service account and API key when the software runs on its own, such as a nightly sync.
Who can manage applications#
Permissions
oauth_application.viewoauth_application.createoauth_application.revokeoauth_application.view. Registering needs oauth_application.create and revoking needs oauth_application.revoke.Register an application#
Open Applications
Go to GovernanceApplications.Name it
Name, at least 2 characters. Users see this name when they approve it.Enter its redirect URLs
Redirect URLs (comma-separated), for examplehttps://example.com/callback. These are the only addresses UnitX will ever send an authorization code to, and they cannot be changed later.Choose its scopes
Tick the permissions the application may use under Scopes. Scopes are permission keys, grouped by area. At least one is required.Choose Create application
Copy the client secret now opens.Store the client secret
This is the only time it is shown; UnitX keeps only a fingerprint of it. Copy it into the application’s secret store, then choose I’ve saved it. If it is lost, register a new application.
The application then appears in the list with its status, Client ID (not secret — the application presents it publicly), scopes, redirect URLs and creation date.
What people see when they approve an application#
When someone starts using the application, it sends them to UnitX’s consent page. If they are not signed in, they sign in first as usual.
- The page asks Allow <app> to use your UnitX account? and explains that it will act as them, in the organization currently selected in UnitX, and only for what is listed.
- It will be able to lists each permission requested, or Nothing beyond identifying you.
- Allow sends them back to the application. Deny shares nothing and shows Not authorized.
- Approving never gives the application their password.
Note
Revoke an application#
Choose Revoke
On an active application in the list.Confirm
Revoke <name>? warns that every access token the application has issued stops working immediately. Choose Revoke.
The application stays in the list as revoked with the date. This cannot be undone — register a new application if you need it again.
For developers: the authorization flow#
UnitX supports the OAuth 2.0 authorization code grant. There are no refresh tokens: when an access token expires, send the person through consent again.
Steps#
- Send the user to the UnitX consent page,
/oauth/consenton the UnitX web address, withclient_id,redirect_uri,scope(space-separated permission keys),stateand, optionally,app_name(the name shown on the page) andcode_challenge(PKCE, S256). - When they choose Allow, UnitX redirects to your
redirect_uriwithcodeand yourstate. Check thatstatematches what you sent. - Exchange the code within 5 minutes by posting JSON to
/oauth/tokenon the UnitX API withgrantTypeset toauthorization_code,clientId,code,redirectUriand eitherclientSecretor, for a public client,codeVerifier. A code works once. - Call the API with
Authorization: Bearer <access token>. The token lasts one hour and is tied to the organization the user approved it in.
- Redirect URI rules
- The redirect URI must exactly match one registered for the application — no partial or pattern matches.
- Scope rules
- An application can only request scopes it was registered with. Asking for others fails with “This application is not registered for scope(s): …”.
- Public clients
- Software that cannot keep a secret, such as a browser extension, is registered as a public client with no client secret and must use PKCE. Public clients are registered through the UnitX API; the Applications form registers confidential clients.
“Invalid, expired, already-used, or redirect-mismatched code”
Codes last 5 minutes, work once, and must be exchanged with the same redirect URI used to obtain them. Start the flow again.
Can a user withdraw their own approval?
Revoking is done by an administrator on the Applications tab, and it stops the application for everyone at once.
What can an access token do?
Only what its approved scopes allow, in the one organization it was approved in. See API overview.
Related pages#
Still stuck? Search the docs with ⌘K, open Help inside UnitX, or contact support.