Authentication & Authorization Demo

Comprehensive Auth Demo: This demo showcases JanusCore's authentication and authorization capabilities, including OAuth flows, admin access, JWT token management, and both SDK and direct API usage patterns. Different endpoints require different permission levels (public, authenticated user, admin-only).

Authentication Status

You are not logged in.

OAuth Authentication

OAuth flow redirects to the identity provider for secure authentication, then returns with a JWT token:

Login with Google Login with Microsoft Login with Facebook

Admin Key Authentication

For demo purposes, login with the test admin key (bypasses OAuth flow and grants admin privileges):

Logged in as: User (user@example.com)

User ID: user-id

Authentication Provider: unknown

Tenant ID: N/A

Roles: []

JWT Token & SDK Utilities

The JWT token is automatically managed by the SDK and stored in localStorage. The SDK also provides built-in token validation and management utilities:

Raw JWT Token

Not logged in

Decoded JWT Payload

Browser-side JWT decoding shows the token's claims and metadata:

Not authenticated

SDK Token Management Utilities

These utilities validate token format, check expiration, and provide helper methods for token lifecycle management:

Not authenticated

API Access Examples

Test different API endpoints with varying authentication requirements:

Public Endpoint

Health check endpoint - no authentication required

Protected - SDK

User profile via SDK client (requires valid JWT)

Protected - Direct API

User profile via direct API call (requires valid JWT)

Admin Only - SDK

Admin dashboard via SDK (requires admin role)

Admin Only - Logs

Admin logs via SDK (requires admin role)

Zone-Based Access

Data query via SDK (public-content zone)