Build integrations · Public
CAS sign-in and session API
Sign users into your application with Skyfallen CAS, then read the current user, tenant, membership, or billing profile.
Breaking change — membership
rolefield
POST /api/cas/membershipno longer returns a human-readable role name inrole.roleis now the tenant role UUID (ornullwhen no role is assigned). The display name is inrole_name.
Clients that comparedmembership.roleto strings such as"Member","admin", or"owner"must switch to the UUID inroleor the label inrole_name. Keep usingpermissionsfor authorization checks.
Skyfallen CAS is an authorization-code sign-in flow for connected applications. The browser visits ONE to sign in and grant consent. Your server exchanges the returned code for a CAS session token, then calls IDMS CAS endpoints with that token.
POST /api/cas/session HTTP/1.1
Host: idms.skyfallen.one
Content-Type: application/json
Accept: application/json
{
"code": "018fd4f9-5c5b-7344-b4e1-d39c64d1770f",
"secret": "cas_app_secret"
}
{
"status": "success",
"token": {
"value": "018fd4fb-8f08-788e-9746-b49af3be8110",
"renew_token": "018fd4fb-97d4-7396-b8cf-f472f9587a15",
"expiry": 1780682400
}
}
Prerequisites
An administrator registers a CAS application in ONE. Members need the cas:auth permission on the tenant they select during consent. Your app needs:
| Setting | Notes |
|---|---|
| App ID | UUID used in the browser authorization URL. |
| Secret | Plain secret shown only at creation. Store it server-side. |
| Redirect URL | Exact callback URL that receives ?code=.... |
| Code expiry | Number of seconds an authorization code remains valid. |
| Session expiry | Number of minutes a CAS session token remains valid. |
Browser authorization
Send the user to the auth domain:
GET /authorise/cas/550e8400-e29b-41d4-a716-446655440000 HTTP/1.1
Host: auth.skyfallen.one
When an enterprise tenant enables custom domain, the same path may be opened on that tenant's custom hostname instead. Sign-in and consent still run in the browser; the server-side code exchange remains on idms.skyfallen.one.
The user signs in, selects a tenant when needed, and grants consent. ONE creates a short-lived authorization code and redirects the browser back to your registered redirect URL.
If your redirect URL is:
https://app.example.net/skyfallen/callback
the browser returns to:
https://app.example.net/skyfallen/callback?code=018fd4f9-5c5b-7344-b4e1-d39c64d1770f
The code is single-use. Exchange it immediately from your backend.
Exchange the code
Call POST /api/cas/session from your backend. Never send the app secret from browser JavaScript.
Invalid or expired codes return:
Invalid secrets return CAS:AUTH002.
{
"status": "error",
"error": {
"title": "Code is invalid",
"message": "The code provided is either not valid or has expired. Please try again with a new code.",
"code": "CAS:AUTH001"
}
}
Read the signed-in user
All other CAS endpoints require a session token in the JSON body.
POST /api/cas/user HTTP/1.1
Host: idms.skyfallen.one
Content-Type: application/json
Accept: application/json
{
"token": "018fd4fb-8f08-788e-9746-b49af3be8110"
}
{
"status": "success",
"user": {
"id": "018fd4c0-e2da-7c7d-8b8e-0f033193b383",
"first_name": "Mavi",
"last_name": "Gökyüzü",
"email": "[email protected]"
}
}
| Method | Path | Response |
|---|---|---|
POST |
/api/cas/session |
token.value, token.renew_token, and Unix token.expiry. |
POST |
/api/cas/user |
The authenticated user for the session tenant. |
POST |
/api/cas/tenant |
The tenant selected during consent. |
POST |
/api/cas/membership |
Role UUID (role), role display name (role_name), and comma-separated permission names. |
POST |
/api/cas/billing |
Billing address, billing email, and billing phone for the tenant. |
POST |
/api/cas/account-delete |
Sends an account deletion link when self deletion is allowed. |
Membership response
role is the tenant role UUID, or null when no role is assigned. role_name is the display name, or null when no role is assigned. Permission names still drive authorization checks.
POST /api/cas/membership HTTP/1.1
Host: idms.skyfallen.one
Content-Type: application/json
Accept: application/json
{
"token": "018fd4fb-8f08-788e-9746-b49af3be8110"
}
{
"status": "success",
"membership": {
"permissions": "iam:members:view,iam:members:manage",
"role": "018fd4c2-57de-7bc4-8e53-4e5758c0f624",
"role_name": "Member"
}
}
Tenant and membership errors
If the user no longer has the tenant membership tied to the CAS session, ONE deletes the session and returns a tenant error.
| Code | Typical action |
|---|---|
CAS:TENANT001 |
Clear your local session and restart authorization before reading user data. |
CAS:TENANT002 |
Clear your local session and restart authorization before reading tenant or billing data. |
CAS:TENANT003 |
Clear your local session and restart authorization before reading membership data. |
Security notes
Use HTTPS on your redirect URL.
Store the CAS token server-side or in a secure, HTTP-only session cookie owned by your application.
Respect token.expiry. When the token expires, clear local state and send the user through authorization again.
If you use the optional state query parameter on the browser authorization URL, ONE preserves it through the pending application flow.