Optare v1.0 is now available. Get started →
Configure
Applications

Applications

An Application in Optare represents an OAuth client - your web app, mobile app, or backend service.

Application Types

TypeUse CaseExample
Single Page App (SPA)Browser-only JavaScriptReact, Vue, Angular
Regular Web AppServer-rendered pagesNext.js, Express, Rails
Native/MobileiOS, Android, DesktopFlutter, Swift, Kotlin
Machine-to-Machine (M2M)Backend servicesCron jobs, APIs

Create an Application

  1. Go to Optare Console (opens in a new tab)
  2. Navigate to ApplicationsOAuth Clients
  3. Click Create Client

Basic Settings

FieldDescription
NameDisplay name for the application
Application TypeSPA, Web App, Native, or M2M
LogoOptional app icon

OAuth Settings

Redirect URIs

URLs where Optare can redirect after authentication.

Development:

https://yourapp.com/callback
https://yourapp.com/api/auth/callback

Production:

https://myapp.com/callback
https://myapp.com/api/auth/callback

Note: Redirect URIs must match exactly. Use separate entries for different paths.

Logout URIs

URLs for post-logout redirects:

https://yourapp.com
https://myapp.com

Allowed Origins (CORS)

Origins allowed to make requests to Optare:

https://yourapp.com
https://myapp.com

Credentials

Client ID

A public identifier for your application. Safe to expose in frontend code.

pub_abc123xyz789

Client Secret

A private key for server-side applications. Never expose in frontend code.

sk_secret_key_here

Warning: Client secrets should only be used in backend applications. SPAs and mobile apps should not use client secrets.

Application Type Details

Single Page App (SPA)

For browser-only JavaScript applications.

Settings:

  • ✅ Use Authorization Code Flow with PKCE
  • ❌ No client secret (public client)
  • ✅ Enable token rotation

Example:

const client = new OptareClient({
  domain: 'https://id.optare.one',
  clientId: 'pub_abc123',
  // No clientSecret for SPAs
});

Regular Web App

For server-rendered applications with a backend.

Settings:

  • ✅ Use Authorization Code Flow
  • ✅ Client secret (confidential client)
  • ✅ Secure token storage (httpOnly cookies)

Example:

const client = new OptareClient({
  domain: 'https://id.optare.one',
  clientId: 'pub_abc123',
  clientSecret: process.env.OPTARE_CLIENT_SECRET, // Server-side only!
});

Native/Mobile App

For iOS, Android, or desktop applications.

Settings:

  • ✅ Use Authorization Code Flow with PKCE
  • ❌ No client secret
  • ✅ Custom URL scheme for redirect

Redirect URI:

myapp://callback
com.mycompany.myapp:/callback

Machine-to-Machine (M2M)

For backend services that don't involve users.

Settings:

  • ✅ Use Client Credentials Flow
  • ✅ Client ID + Client Secret
  • ✅ Scoped to specific APIs

Example:

const token = await client.auth.getM2MToken({
  clientId: 'srv_abc123',
  clientSecret: process.env.SERVICE_SECRET,
  audience: 'https://api.myapp.com',
});

Scopes

Define what data and actions the application can access.

Standard Scopes

ScopeAccess
openidUser identifier
profileName, picture
emailEmail address
offline_accessRefresh tokens

Organization Scopes

ScopeAccess
organizationCurrent organization
organization:readRead org details
organization:writeModify org settings

Custom Scopes

Define custom scopes for your APIs:

read:products
write:products
admin:users

Rotate Credentials

To rotate a client secret:

  1. Go to your application settings
  2. Click Rotate Secret
  3. Copy the new secret
  4. Update your application
  5. The old secret remains valid for 24 hours

Delete an Application

  1. Go to application settings
  2. Scroll to Danger Zone
  3. Click Delete Application
  4. Confirm deletion

Warning: Deleting an application immediately invalidates all tokens. Users will be logged out.


Next Steps