Developer Documentation
Codevertex SSO API Reference & Integration Guide
Quick Start
Base URL
https://sso.codevertexitsolutions.comAuthentication
All authenticated endpoints require a Bearer token in the Authorization header:
curl -X GET "https://sso.codevertexitsolutions.com/api/v1/auth/me" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"Example: User Login
curl -X POST "https://sso.codevertexitsolutions.com/api/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your_password",
"tenant_slug": "your-tenant"
}'Response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
"token_type": "Bearer",
"expires_in": 3600,
"user": {
"id": "uuid",
"email": "user@example.com",
"roles": ["customer"]
}
}API Endpoints
Authentication
/api/v1/auth/registerCreate a new user account
/api/v1/auth/loginAuthenticate with email and password
/api/v1/auth/refreshRefresh an expired access token
/api/v1/auth/meAuthGet current authenticated user
/api/v1/auth/logoutAuthInvalidate the current session
/api/v1/auth/password-reset/requestRequest password reset email
/api/v1/auth/password-reset/confirmConfirm password reset with token
OAuth Providers
/api/v1/auth/oauth/google/startStart Google OAuth flow
/api/v1/auth/oauth/google/callbackHandle Google OAuth callback
/api/v1/auth/oauth/github/startStart GitHub OAuth flow
/api/v1/auth/oauth/github/callbackHandle GitHub OAuth callback
/api/v1/auth/oauth/microsoft/startStart Microsoft OAuth flow
/api/v1/auth/oauth/microsoft/callbackHandle Microsoft OAuth callback
Multi-Factor Authentication
/api/v1/auth/mfa/totp/startAuthStart TOTP setup (returns QR code)
/api/v1/auth/mfa/totp/confirmAuthConfirm TOTP setup with code
/api/v1/auth/mfa/backup-codes/regenerateAuthGenerate new backup codes
/api/v1/auth/mfa/backup-codes/consumeAuthUse a backup code for authentication
OpenID Connect
/.well-known/openid-configurationOIDC discovery document
/.well-known/jwks.jsonJSON Web Key Set for token verification
/api/v1/authorizeOAuth2 authorization endpoint
/api/v1/tokenOAuth2 token endpoint
/api/v1/userinfoAuthGet user info from access token
Admin & Tenant Management
Admin Scope Required/api/v1/admin/tenantsAuthCreate a new tenant
/api/v1/admin/tenantsAuthList all tenants
/api/v1/admin/clientsAuthCreate an OAuth client
/api/v1/admin/clientsAuthList OAuth clients
/api/v1/admin/entitlementsAuthManage service entitlements
/api/v1/admin/keys/rotateAuthRotate signing keys
SDK Integration
JavaScript / TypeScript
// Example: TypeScript/Next.js with axios
import axios from 'axios';
const api = axios.create({
baseURL: 'https://sso.codevertexitsolutions.com/api/v1',
withCredentials: true, // for httpOnly cookies
});
// Login endpoint
const response = await api.post('/auth/login', {
email: 'user@example.com',
password: 'password',
tenant_slug: 'your-tenant',
});
const { access_token, user } = response.data;
// Use token in subsequent requests
api.defaults.headers.common['Authorization'] = `Bearer ${access_token}`;
// Get current user
const meResponse = await api.get('/auth/me');
console.log(meResponse.data.user);Go
// Install Shared Auth Client (JWT validation)
go get github.com/Bengo-Hub/shared-auth-client
// Use with Chi router middleware
import authclient "github.com/Bengo-Hub/shared-auth-client"
// Initialize JWT validator
validator := authclient.NewValidator(authclient.Config{
IssuerURL: "https://sso.codevertexitsolutions.com",
Audience: "your-service",
})
// Add to router middleware
router.Use(authclient.AuthMiddleware(validator))
// Access claims in handlers
router.Get("/api/v1/protected", func(w http.ResponseWriter, r *http.Request) {
claims := authclient.ClaimsFromContext(r.Context())
userID := claims.Subject
// ... handle request
})SDK & Libraries
Shared Auth Client (Go)
Go SDK for JWT validation, JWKS support, and auth middleware integration.
View on GitHubQuick Installation
go get github.com/Bengo-Hub/shared-auth-clientReady to integrate?
Create your OAuth client in the Developer Portal and start building with Codevertex SSO today.