Auth
Initiate Google OAuth login flow
Args: redirect_uri: Frontend callback URL team_id: Optional team context to include in JWT (will be validated)
Returns: Redirect to Google OAuth consent screen
Requested team context for JWT
Successful Response
Validation Error
No content
Handle OAuth callback and exchange code for JWT token
Args: request: Authorization code from Google plus optional state
Returns: JWT token and user context
Successful Response
Validation Error
Get current user context with org/team/project names and profile info.
Performance optimized: All data is embedded in JWT during login. No database queries are made - this endpoint is lightning fast.
Returns: Current user context with roles, permissions, display names, and profile picture
Successful Response
Validation Error
Switch team/project context
DISABLED FOR MULTI-DOMAIN ARCHITECTURE
In a multi-domain setup, each team has its own domain (e.g., team-a.example.com, team-b.example.com). Users should access the team's specific domain directly rather than switching contexts.
To access a different team:
Logout from current domain
Navigate to the target team's domain
Login with that team's context
Args: request: New team_id and/or project_id
Returns: Error indicating team switching is not supported
Successful Response
Validation Error
Logout user
Logs logout event for audit trail. In the future, this endpoint can be extended to:
Invalidate tokens (token blacklist)
Clear server-side sessions
Log security events
Args: current_user: Current authenticated user from JWT token
Returns: Success message
Successful Response
Validation Error
No content
SSO Login Page - Opens in popup, handles entire OAuth flow.
This endpoint renders a login page that:
Shows "Sign in with Google" button
Redirects to Google OAuth
On success, sends token via postMessage to opener window
Closes popup automatically
Usage (Consumer UI):
// Open SSO popup
const popup = window.open(
'https://auth-guard.run.app/v1/auth/sso?origin=' + encodeURIComponent(window.location.origin),
'Atlas SSO',
'width=500,height=600'
);
// Listen for auth result
window.addEventListener('message', (event) => {
if (event.data.type === 'ATLAS_AUTH_SUCCESS') {
const { token, user } = event.data;
localStorage.setItem('auth_token', token);
// User is logged in!
}
});Args: origin: Consumer app origin (e.g., https://myapp.turing.com) team_id: Optional team ID for team-specific login
Returns: HTML login page
Origin URL of the consumer app (for postMessage)
Optional team ID for team-specific login
Optional project ID for project-specific login (requires team_id)
Successful Response
Validation Error
SSO Callback - Internal endpoint for OAuth callback.
This endpoint:
Exchanges authorization code for tokens
Creates/updates user in database
Generates JWT
Returns HTML that sends postMessage to opener window
This is called by Google OAuth redirect, not by consumer apps directly.
Successful Response
Validation Error
Last updated