Skip to content

Applications

Applications in AuthStack represent OAuth clients that can authenticate users through your AuthStack organization. Each application has its own credentials, redirect URIs, and webhook configurations.

Applications are the core building blocks of your authentication setup:

  • Client credentials - Each app has a unique Client ID and Secret
  • OAuth providers - Configure which social logins are available
  • Webhooks - Receive real-time notifications for user events
  • Usage tracking - Monitor authentication requests per application
  • Custom branding - Personalize the OAuth login page with your app’s colors and logo
MethodEndpointDescription
GET/api/applicationsList all applications
GET/api/applications/{appId}Get application details
POST/api/applicationsCreate a new application
PUT/api/applications/{appId}Update an application
DELETE/api/applications/{appId}Delete an application
POST/api/applications/{appId}/regenerate-secretRegenerate client secret

See Webhooks API for detailed webhook documentation.

MethodEndpointDescription
GET/api/applications/{appId}/webhooksList webhooks
POST/api/applications/{appId}/webhooksCreate webhook
PUT/api/applications/{appId}/webhooks/{webhookId}Update webhook
DELETE/api/applications/{appId}/webhooks/{webhookId}Delete webhook
MethodEndpointDescription
GET/api/applications/{appId}/providersList enabled providers
POST/api/applications/{appId}/providersEnable a provider
DELETE/api/applications/{appId}/providers/{providerId}Disable a provider
POST /api/applications
Authorization: Bearer <access_token>
Content-Type: application/json
{
"name": "My Mobile App",
"description": "iOS and Android mobile application",
"logoUrl": "https://myapp.com/logo.png",
"primaryColor": "#3B82F6",
"secondaryColor": "#10B981",
"redirectUris": [
"myapp://callback",
"https://myapp.com/auth/callback"
]
}
FieldTypeRequiredDescription
namestringYesApplication name displayed to users
descriptionstringNoBrief description of your application
logoUrlstringNoURL to your app’s logo (displayed on OAuth page)
primaryColorstringNoHex color for primary UI elements (e.g., #3B82F6)
secondaryColorstringNoHex color for secondary UI elements
redirectUrisstring[]NoAllowed OAuth callback URLs
allowedScopesstring[]NoOAuth scopes this app can request
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Mobile App",
"description": "iOS and Android mobile application",
"clientId": "1OXlgFq035ixdKA8A3tMDqiIF-IMkgEO",
"clientSecret": "cs_abc123...",
"logoUrl": "https://myapp.com/logo.png",
"primaryColor": "#3B82F6",
"secondaryColor": "#10B981",
"redirectUris": [
"myapp://callback",
"https://myapp.com/auth/callback"
],
"isActive": true,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": null
}
GET /api/applications/{appId}
Authorization: Bearer <access_token>
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "My Mobile App",
"description": "iOS and Android mobile application",
"clientId": "1OXlgFq035ixdKA8A3tMDqiIF-IMkgEO",
"logoUrl": "https://myapp.com/logo.png",
"primaryColor": "#3B82F6",
"secondaryColor": "#10B981",
"redirectUris": [
"myapp://callback",
"https://myapp.com/auth/callback"
],
"isActive": true,
"createdAt": "2025-01-15T10:30:00Z",
"updatedAt": "2025-01-16T14:22:00Z",
"providers": [
{
"id": "provider-id",
"type": "google",
"isEnabled": true
}
]
}
PUT /api/applications/{appId}
Authorization: Bearer <access_token>
Content-Type: application/json
{
"name": "My Updated App",
"description": "Updated description",
"logoUrl": "https://myapp.com/new-logo.png",
"primaryColor": "#6366F1",
"secondaryColor": "#22C55E",
"redirectUris": [
"myapp://callback",
"https://myapp.com/auth/callback",
"https://staging.myapp.com/auth/callback"
],
"isActive": true
}

If your client secret is compromised, regenerate it:

POST /api/applications/{appId}/regenerate-secret
Authorization: Bearer <access_token>
{
"clientSecret": "cs_newSecret456..."
}
DELETE /api/applications/{appId}
Authorization: Bearer <access_token>

Configure which OAuth providers are available for each application.

POST /api/applications/{appId}/providers
Authorization: Bearer <access_token>
Content-Type: application/json
{
"type": "google",
"clientId": "your-google-client-id",
"clientSecret": "your-google-client-secret"
}
ProviderType ValueStatus
GooglegoogleAvailable
GitHubgithubAvailable
MicrosoftmicrosoftAvailable
AppleappleAvailable
DiscorddiscordAvailable

Each application can have multiple webhooks to receive real-time notifications. See the Webhooks API documentation for:

  • Creating and managing webhooks
  • Verifying webhook signatures
  • Handling webhook events
  • Retry behavior and best practices

Applications use the OAuth 2.0 Authorization Code flow with PKCE to authenticate users. See the OAuth 2.0 Authorization documentation for complete details.

  1. Redirect users to /oauth/authorize with your client_id and redirect_uri
  2. Users see a login page with email/password and social login options
  3. After login, users are redirected to your redirect_uri with an authorization code
  4. Exchange the code for tokens at /oauth/token
GET /oauth/authorize?
client_id=YOUR_CLIENT_ID&
redirect_uri=https://yourapp.com/callback&
response_type=code&
scope=openid profile email&
code_challenge=PKCE_CHALLENGE&
code_challenge_method=S256

For server-to-server authentication, use client credentials:

POST /oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&
client_id=YOUR_CLIENT_ID&
client_secret=YOUR_CLIENT_SECRET

Personalize the OAuth authorization page with your application’s branding to provide a seamless authentication experience for your users.

FieldDescriptionExample
logoUrlURL to your application’s logo (recommended: 128x128px PNG)https://myapp.com/logo.png
primaryColorHex color for buttons and primary UI elements#3B82F6
secondaryColorHex color for secondary accents#10B981

When users are redirected to the AuthStack OAuth authorization page, your custom branding is displayed:

  • Logo - Shown at the top of the login form (falls back to app initial if not set)
  • Primary Color - Applied to the “Sign In” button and checkmarks
  • Secondary Color - Used for secondary UI accents
{
"logoUrl": "https://myapp.com/logo.png",
"primaryColor": "#6366F1",
"secondaryColor": "#22C55E"
}
  1. Separate environments - Create different applications for development, staging, and production
  2. Limit redirect URIs - Only include necessary callback URLs
  3. Rotate secrets - Periodically regenerate client secrets
  4. Monitor usage - Review authentication metrics in the dashboard
  5. Configure webhooks - Set up webhooks to react to user events in real-time
  6. Use custom branding - Add your logo and colors for a seamless authentication experience
Status CodeDescription
400Invalid request (missing name, invalid redirect URI)
401Unauthorized - invalid or expired token
403Forbidden - not authorized for this organization
404Application not found
409Conflict - application name already exists
500Server error