Authentication
Obtain an access token with OAuth 2.0 — password, authorization code and device code grants.
OAuth 2.0 authorization methods in VARIO Cloud
In addition to its App frameworks, VARIO-Cloud exposes an HTTP API that is protected using OAuth 2.0. You can choose between three authorization methods:
Password grant
Authorization Code grant
Device Code grant
All methods use the client credentials (clientId, clientSecret) that you obtain when creating an App in the Developer section.
Realms
Every installation has its own realm. A test system and a live system are therefore separate realms with separate users, clients and tokens — a token issued by one is never valid for the other.
That is why the token endpoint carries the tenant in its path:
https://sso.vario.cloud/realms/<TENANT>/protocol/openid-connect/tokenCredentials are consequently not portable between installations: an integration that talks to several installations needs one client and one set of tokens per installation.
Token lifetimes
Access token
60 seconds
—
Refresh token
1 hour of inactivity
10 hours
The refresh token is sliding: every use resets its inactivity window. But there is also an absolute ceiling — once it is reached, the token expires no matter how active the session was.
The practical pattern is a hook that runs before every request:
Long-running access: the offline_access scope
If your integration has to keep running unattended, request the scope offline_access when the API access is created. The refresh token you then receive is an offline token, and it has no expiry date.
Password grant
The Password grant allows your App to exchange a user’s username and password directly for an access token.
When to use
For trusted, server-side applications that can securely store user credentials and client secrets.
For system integrations where a technical user is used for automation.
Requirements
To use the Password grant, you need:
a user account in the VARIO-Cloud tenant
the user’s password
the App’s Client ID (
clientId)the App’s Client Secret (
clientSecret)the user must be explicitly allowed to use the Password grant in their user settings
Enabling the Password grant for a user
The Password grant is disabled by default for all users and must be enabled per user and per installation.
Sign in to your VARIO-Cloud tenant as an administrator.
Open the “Benutzer” (Users) menu.
Select the user who should be allowed to authenticate via Password grant.
Select the relevant installation (tenant / environment) for that user.
Activate the checkbox &#xNAN;„OAuth-Password-Grant-Type erlauben“ (Allow OAuth Password Grant Type).
Save your changes.
Only users with this option enabled can obtain tokens via the Password grant.
Requesting a token with the Password grant
Once the user is enabled, you can request an access token with a standard OAuth 2.0 Password grant request:
The response contains an access_token (and usually a refresh_token), which you then use for API calls.
Authorization Code grant
The Authorization Code grant is the standard flow for web applications and other clients that can handle browser redirects. The user signs in via the VARIO-Cloud login page, and your App never sees the user’s password.
When to use
For browser-based or server-side web apps with a backend that can receive HTTP callbacks.
When you want the user to explicitly approve the App’s access the first time it connects.
Requirements
To use the Authorization Code grant, you need:
a user account in the tenant (the end-user who will authorize the App)
the App’s Client ID and Client Secret
a running OAuth callback server, i.e. a backend endpoint that:
is reachable from the internet, and
can receive the
redirect_uricallback
the callback URL must be registered for the App (according to your tenant configuration)
Typical flow
Redirect the user to the VARIO-Cloud authorization endpoint:
The user logs in (if not already authenticated) and is asked to grant access to your App.
VARIO-Cloud redirects the user back to your
redirect_uriwith acodeandstateparameter.Your backend exchanges the authorization code for tokens:
The response contains an
access_token(and usually arefresh_token), which you then use for API calls.
Last updated
Was this helpful?