Omada Connected Apps — Developer Integration Guide
This guide is for developers building micro-applications or external applications that want to use Omada as the authentication provider. It covers the technical configuration needed to connect your app to Omada using standard OAuth 2.0 / OpenID Connect (OIDC).
Building with an AI coding assistant? See the AI Agent Integration Prompts section at the end of this guide for ready-to-use prompts you can give to your IDE AI assistant (GitHub Copilot, Cursor, Cline, etc.).
What You're Integrating With
Omada acts as an OpenID Connect provider (an identity provider, the same role Google or Microsoft plays when you see "Sign in with Google"). Your app doesn't need to build or store its own login system — it redirects users to Omada to authenticate, and receives back a signed token confirming who the user is and their role at their company.
Protocol: OAuth 2.0 Authorization Code flow with PKCE (Proof Key for Code Exchange)
Flow: Authorization Code with PKCE (server-side apps) — Client Credentials flow is not supported (all authentication must be user-initiated)
What You'll Receive From the Company Admin
Before you can integrate, the company using your app will register it inside Omada (under Company Admin → Connected Apps) and provide you with:
- Client ID — a public identifier for your app
- Client Secret — a private credential (treat this like a password; never expose it in frontend/client-side code)
- Redirect URI — you must provide the exact callback URL where your app will receive the authorization response (must match exactly, including protocol, path, and no trailing slash mismatches)
Endpoints
| Purpose | URL |
|---|---|
| Discovery document | https://app.myomada.com/.well-known/openid-configuration |
| Authorization endpoint | https://app.myomada.com/connect/authorize |
| Token endpoint | https://app.myomada.com/connect/token |
| User info endpoint | https://app.myomada.com/connect/userinfo |
Discovery document: The /.well-known/openid-configuration endpoint is the standard OIDC metadata document — most OIDC libraries can auto-discover all other endpoints when you provide just the issuer URL (https://app.myomada.com).
Development/Testing: For local development against a test Omada instance, the issuer URL is https://localhost:7274. This is only accessible if you're running the Omada development environment locally.
Step 1: Register Your Redirect URI
Your app needs a specific route/page dedicated to receiving the authorization response from Omada — commonly called a "callback" or "redirect" route. Common examples:
https://yourapp.com/api/auth/callback/omadahttps://yourapp.com/auth/callbackhttp://localhost:3000/api/auth/callback/omada(for local development)
Important: This URL must be registered exactly in Omada (protocol, domain, path, no trailing slash) or authorization requests will be rejected as a security precaution. You can update this later if needed by asking the company's Omada admin to modify the Connected App registration.
Step 2: Choose Your OIDC Client Library
Do not implement the OAuth flow manually. Use a well-maintained OIDC client library for your platform:
| Stack | Recommended library |
|---|---|
| Next.js | Auth.js (NextAuth) — generic OIDC provider config |
| Node.js / Express | openid-client |
| Python | authlib |
| .NET | Microsoft.AspNetCore.Authentication.OpenIdConnect |
| Ruby on Rails | omniauth-openid-connect |
| SvelteKit | @auth/sveltekit with generic OIDC provider |
These libraries handle:
- Authorization redirect with PKCE
- Token exchange and validation
- Session management
- Token refresh (if supported)
Example: Auth.js (NextAuth) generic OIDC provider config
import { Auth } from "@auth/core"
export const authConfig = {
providers: [
{
id: "omada",
name: "Omada",
type: "oidc",
issuer: "https://app.myomada.com",
clientId: process.env.OMADA_CLIENT_ID,
clientSecret: process.env.OMADA_CLIENT_SECRET,
authorization: { params: { scope: "openid profile email" } },
},
],
}
Security: Store OMADA_CLIENT_ID and OMADA_CLIENT_SECRET as environment variables or secrets in your hosting platform (Vercel, Railway, AWS, etc.) — never commit credentials to source control.
Step 3: Request the Right Scopes
Request these three scopes during authorization:
openid profile email
openidis required for any OIDC flow — it's what tells Omada to issue an identity token, not just a bare access token.profileandemailunlock additional user claims (name, email, job title, company role)
Step 4: What You'll Get Back
After a successful login, your app receives a token containing these claims:
| Claim | Description |
|---|---|
sub |
Unique, stable identifier for this user — use this as your internal "who is this" key, not email (emails can change) |
name |
User's full name (typically "First Last") |
email |
User's email address |
company_id |
Identifier for the company this user belongs to (in Omada) |
company_role |
Admin, Manager, or Staff — the user's role within their company in Omada |
company_user_id |
Internal identifier for the user's company-membership record |
job_title |
The user's job title at their company |
Multi-tenancy note: Each Connected App registration in Omada is tied to one company. All users logging in through the same registration will share the same company_id. If your app serves multiple companies, each company will register separately with their own client_id/client_secret pair.
Example decoded identity token payload
{
"sub": "482",
"name": "Alex Rivera",
"email": "alex@example.com",
"company_id": "17",
"company_role": "Admin",
"company_user_id": "1043",
"job_title": "Operations Manager",
"iss": "https://app.myomada.com",
"aud": "your-client-id"
}
Step 5: Handle Session and Access Control in Your App
Omada confirms the user is authenticated and provides their company role — but your app is responsible for access control and feature permissions. Common pattern:
- On first login: Create or update a user record in your database, keyed by
sub(the stable user ID from Omada) - Store the role: Persist
company_roleto determine what features the user can access - Check on each request: Always verify
company_rolefrom the current token/session, not from stale cached data
Token Refresh
Omada supports refresh tokens. If your OIDC library handles token refresh automatically (most do), no extra work is needed. Be aware:
- On every token refresh, Omada re-validates that the user is still an active member of the company
- If a user is deactivated or removed from the company in Omada, token refresh will fail and they'll be logged out
Testing Your Integration
1. Test the Authorization Flow
- Click your "Sign in with Omada" button
- You should be redirected to
https://app.myomada.com/connect/authorize - After logging in (or if already logged in), you should be redirected back to your registered callback URL with an authorization code
2. Verify Token Claims
Print or log the decoded ID token to verify you're receiving all expected claims (sub, name, email, company_id, company_role, job_title)
3. Test Token Refresh
Wait until your access token expires (or force expiration if your library supports it) and verify that refresh works without requiring re-authentication
4. Test Revocation
Have the Omada admin deactivate your test user in their company and verify that:
- Token refresh fails
- User is logged out or denied access on next request
Common Issues
| Problem | Solution |
|---|---|
| Redirect URI mismatch | Verify the callback URL in your code exactly matches what's registered in Omada (including protocol, domain, path, and no trailing slash differences) |
| Missing claims in token | Ensure you're requesting openid profile email scopes |
| Token validation fails | Check that your OIDC library is configured with the correct issuer (https://app.myomada.com) and is fetching the JWKS from the discovery document |
| User stays at dashboard instead of returning to app | This was a known issue, now fixed. If you encounter it, contact Omada support. |
Security Best Practices
- Never expose
client_secretin client-side code — it must only be used server-side - Always validate tokens — don't trust the contents without signature verification (your OIDC library handles this)
- Use HTTPS in production — OAuth flows must not run over plain HTTP in production environments
- Store tokens securely — use HTTP-only, secure cookies for session tokens; never store tokens in localStorage
- Implement CSRF protection — use the
stateparameter (most libraries handle this automatically)
AI Agent Integration Prompts
If you're using an AI coding assistant (GitHub Copilot, Cursor, Cline, etc.) to help implement Omada authentication, use these prompts to guide your agent. Copy the relevant prompt and paste it into your AI chat, along with this developer guide as context.
Initial Setup Prompt
I need to add Omada authentication to my application using OAuth 2.0 / OpenID Connect.
Context:
- My stack: [Next.js / SvelteKit / Python Flask / etc.]
- I have a Client ID and Client Secret from the Omada admin
- Omada's issuer URL: https://app.myomada.com
- My callback URL will be: [your callback URL]
Requirements:
1. Install and configure an OIDC client library appropriate for my stack
2. Set up environment variables for OMADA_CLIENT_ID and OMADA_CLIENT_SECRET
3. Configure the OIDC provider with:
- Issuer: https://app.myomada.com
- Scopes: openid profile email
- Authorization endpoint: https://app.myomada.com/connect/authorize
- Token endpoint: https://app.myomada.com/connect/token
4. Create a callback route to handle the authorization response
5. Set up session management to store the user's identity
Show me the complete implementation with code examples.
Token Claims Extraction Prompt
I've set up Omada authentication and successfully receive an ID token. Now I need to extract and use the custom claims that Omada provides.
Expected claims in the token:
- sub: unique user ID
- name: full name
- email: email address
- company_id: company identifier
- company_role: "Admin", "Manager", or "Staff"
- company_user_id: internal company-user record ID
- job_title: user's job title
Requirements:
1. Show me how to decode and access these claims from the ID token in my [language/framework]
2. Create a user profile object or model to store these claims
3. Demonstrate how to check company_role to gate access to admin-only features
4. Handle the case where expected claims are missing gracefully
Provide code examples.
Database Integration Prompt
I need to store Omada user data in my application's database and sync it on each login.
Context:
- Database: [PostgreSQL / MongoDB / etc.]
- ORM/Query builder: [Prisma / SQLAlchemy / etc.]
Requirements:
1. Create a users table/collection schema with fields for:
- omada_user_id (the 'sub' claim - unique, indexed)
- email
- name
- company_id
- company_role
- job_title
- created_at, updated_at
2. Implement "upsert" logic: on each login, either create a new user record or update the existing one (keyed by omada_user_id)
3. Show how to retrieve the current user's record in protected routes/pages
4. Demonstrate role-based access control using company_role
Provide schema definitions and code examples.
Middleware/Route Protection Prompt
I need to protect certain routes in my application so only authenticated Omada users can access them, and some routes should be admin-only.
Context:
- Framework: [Next.js / Express / FastAPI / etc.]
Requirements:
1. Create authentication middleware that:
- Checks if the user has a valid session with Omada
- Redirects unauthenticated users to the login page
- Loads the user's company_role from the session/token
2. Create authorization middleware that:
- Checks the user's company_role claim
- Restricts access based on role (e.g., admin-only routes)
- Returns 403 Forbidden if the user lacks required permissions
3. Show how to apply these middlewares to routes
4. Handle the "Sign in with Omada" button that initiates the OAuth flow
Provide complete middleware implementations and usage examples.
Sign Out Prompt
I need to implement a sign-out feature that logs users out of both my application and Omada.
Requirements:
1. Clear the local session in my application
2. Revoke the access token if possible
3. Optionally redirect the user to Omada's logout endpoint (if available) to end their Omada session
4. Handle the case where the user is already logged out gracefully
Show me how to implement a complete sign-out flow.
Support
If you encounter issues during integration or have questions not covered in this guide, contact the company's Omada administrator or reach out to Omada support at [support contact].
- Don't cache
company_roleorjob_titleindefinitely on your end without expecting it to change — these can be updated by the company admin over time, and will be refreshed the next time the user's token is renewed.
Security Notes
- Never expose your Client Secret in frontend code. If your app has both a frontend and backend, the OAuth token exchange must happen server-side.
- Always use HTTPS for your redirect URI in production. Omada will not issue tokens to a non-HTTPS redirect URI outside of local development.
- PKCE is required — most modern OIDC libraries handle this automatically, but if you're implementing the flow manually for any reason, you must generate and send a PKCE code challenge/verifier pair.
- Validate the token signature — if you're not using a standard OIDC library that does this for you, do not skip signature verification of the identity token.
Testing Your Integration
- Confirm the discovery document loads: visit
https://app.myomada.com/.well-known/openid-configurationin a browser — you should see a JSON document listing the endpoints. - Attempt a login from your app — you should be redirected to Omada's login page (or pass through automatically if already logged in).
- After logging in as a user who is an active member of the registered company, you should be redirected back to your app's callback URL with an authorization code, which your OIDC library will exchange for tokens automatically.
- If login fails with an access-denied style error, the most common cause is that the logged-in Omada user is not an active member of the company the app was registered under.
Support
If you run into issues connecting your app, have the company's Omada admin reach out to support@myomada.com — they can confirm the app's registration details (redirect URI, client ID) on the Omada side.