Authentication & Identity
Funtico provides a complete authentication and identity system through Login with Funtico, built on the OpenID Connect (OIDC) standard. This allows users to authenticate with their Funtico account and access their account details across multiple games and applications as well as play in the Platform tournaments.
Login with Funtico is an OIDC-compliant identity provider that enables:
- Single Sign-On (SSO) - Users authenticate once and access multiple games
- Secure Token Management - Access tokens for API calls and refresh tokens for session persistence
- User Profile Access - Retrieve user information like email, username, and balance
- Standard Compliance - Works with any OIDC-compliant library or SDK
OpenID Connect (OIDC)
Section titled âOpenID Connect (OIDC)âFuntico implements the OpenID Connect standard, which is built on top of OAuth 2.0. OIDC provides:
- Identity Layer - Extends OAuth 2.0 with identity verification
- Standardized User Info - Consistent user profile data across applications
- Security Best Practices - PKCE, state validation, and secure token handling
- Library Compatibility - Works with any OIDC-compliant client library
Why OIDC?
Section titled âWhy OIDC?âOIDC is the industry standard for authentication because it:
- Eliminates password sharing between games and applications
- Provides secure token-based authentication with automatic refresh
- Offers standardized user profile data (email, username, etc.)
- Supports multiple grant types for different use cases
- Enables single sign-on across your entire ecosystem
Authentication Flow
Section titled âAuthentication FlowâThe Login with Funtico flow follows the standard OAuth 2.0 Authorization Code flow with PKCE:
sequenceDiagram
participant U as User
participant G as Game
participant A as Auth Server
participant T as Token Endpoint
U->>G: Click "Login with Funtico"
G->>A: Authorization request with PKCE
A->>U: Redirect to login page
U->>A: Enter credentials
A->>G: Redirect with authorization code
G->>T: Exchange code for tokens
T-->>G: Access token + refresh token
G->>A: Get user profile
A-->>G: User information
Flow Steps
Section titled âFlow Stepsâ- Authorization Request - Game redirects user to Funtico with PKCE challenge
- User Authentication - User logs in to their Funtico account
- Authorization Grant - Funtico redirects back with authorization code
- Token Exchange - Game exchanges code for access and refresh tokens
- Profile Access - Game uses access token to fetch user information
Client Registration
Section titled âClient RegistrationâRegistration Process
Section titled âRegistration ProcessâGames register their OIDC clients through the Funtico Developer Dashboard:
- Create Auth Client - Register a new authentication client (confidential or public)
- Configure Redirect URIs - Specify where users return after authentication
- Set Legal URLs - Provide Terms of Service and Privacy Policy URLs
- Optional Branding - Add logo for a customized login experience
Client Types
Section titled âClient Typesâ- Confidential Client - Has a client secret, suitable for backend applications that support full SDK functionality
- Public Client - No client secret, suitable for frontend-only applications with limited functionality (tournaments and payments require backend implementation)
Required Configuration
Section titled âRequired Configurationâ- Client Name - Human-readable name for your application
- Redirect URIs - At least one callback URL where users return after login
Optional Configuration
Section titled âOptional Configurationâ- Logo URI - Custom logo displayed during authentication
- Post Logout Redirect URIs - URLs to redirect after logout (defaults to redirect URIs if not specified)
- Terms of Service URI - URL to your terms of service
- Privacy Policy URI - URL to your privacy policy
Automatic Configuration
Section titled âAutomatic ConfigurationâFuntico automatically configures your client with:
- Grant Types:
authorization_code,refresh_token - Response Types:
code - Token Endpoint Auth Method:
client_secret_basic(confidential) ornone(public) - Scopes: All available scopes, see Available Scopes
- Audience:
core.funtico.com- The Funtico Platform API service
Scopes and Permissions
Section titled âScopes and PermissionsâFuntico provides several scopes that control what user information your application can access:
Available Scopes
Section titled âAvailable Scopesâopenid- Required for OIDC complianceoffline_access- Permission to receive refresh tokens for long-term accessprofile- Access to user profile information (username, display name)email- Access to userâs email addressbalance:read- Access to userâs TICO balancetransactions:read- Access to userâs transaction historytournaments:read- Access to userâs tournament historytournaments:play- Permission to join and play in tournamentsprogression:read- Access to userâs rank and level data
Applications can request any combination of available scopes.
Token Management
Section titled âToken ManagementâAccess Tokens
Section titled âAccess Tokensâ- Opaque - Cannot be decoded, do not need to be revoked
- Short-lived - valid for 1 hour
- API Authorization - Used to access Funtico APIs
- User Profile - Retrieve user information and balance
- Secure Storage - Store securely in your application
Refresh Tokens
Section titled âRefresh Tokensâ- Long-lived - Valid for 7 days
- Automatic Renewal - Exchange for new access tokens (valid for 1 day when refreshed)
- Offline Access - Enable background token refresh
- Secure Storage - Store securely with encryption
Token Security
Section titled âToken Securityâ- HTTPS Only - All token exchanges use HTTPS
- PKCE Protection - Prevents authorization code interception
- State Validation - Prevents CSRF attacks
- Secure Storage - Tokens should be stored securely
User Information
Section titled âUser InformationâStandard Claims
Section titled âStandard ClaimsâFuntico provides standard OIDC claims:
sub- Unique user identifieremail- Userâs email addressemail_verified- Whether email is verifiedname- Userâs display namepreferred_username- Userâs chosen usernameimage- Userâs avatar image URL
Custom Claims
Section titled âCustom ClaimsâFuntico extends standard claims with:
frame- Userâs avatar image frame URL
Additional Data Access
Section titled âAdditional Data AccessâUser balance, progression, transaction history, and tournament data are accessed through the Funtico Platform API (core.funtico.com) using your access token, not through /userinfo OIDC endpoint.
Security Considerations
Section titled âSecurity ConsiderationsâBest Practices
Section titled âBest Practicesâ- Use PKCE - Always implement PKCE for public clients
- Validate State - Verify state parameter to prevent CSRF
- Secure Storage - Store tokens securely with encryption
- Token Refresh - Implement automatic token refresh
- Error Handling - Handle authentication errors gracefully
Security Features
Section titled âSecurity Featuresâ- HTTPS Enforcement - All communications use HTTPS
- Token Encryption - Tokens are encrypted in transit
- Scope Validation - Only requested scopes are granted
- Client Validation - Clients are validated against registered URIs
Integration Options
Section titled âIntegration OptionsâStandard OIDC Libraries
Section titled âStandard OIDC LibrariesâSince Funtico implements standard OIDC, you can use any OIDC-compliant library:
- JavaScript/TypeScript:
oidc-client-js,@auth0/auth0-spa-js - Python:
authlib,python-jose - Java:
spring-security-oauth2,nimbus-jose-jwt - C#:
IdentityModel,Microsoft.Identity.Web - Go:
golang.org/x/oauth2,github.com/coreos/go-oidc
Funtico SDK
Section titled âFuntico SDKâFor the easiest integration, use the official Funtico SDK:
import { FunticoSDK } from '@pillarex/funtico-sdk';
const sdk = new FunticoSDK({ authClientId: 'your-auth-client-id', authClientSecret: 'your-auth-client-secret', env: 'staging'});Use Cases
Section titled âUse CasesâGame Integration
Section titled âGame Integrationâ- User Authentication - Players log in with their Funtico account
- Balance Access - Check userâs TICO balance for purchases
- Profile Information - Display userâs name and avatar
- Cross-Game Identity - Same account across multiple games
Application Integration
Section titled âApplication Integrationâ- Single Sign-On - Users authenticate once for multiple services
- Payment Integration - Access TICO balance for transactions
- User Management - Centralized user profiles and preferences
- Security - Secure, token-based authentication
Next Steps
Section titled âNext Stepsâ- Login Integration - Implement Login with Funtico
- User Data Access - Retrieve user information