Identity & Access

Mission-Critical Authentication

Afribase Auth provides a hardened, enterprise-grade authentication solution built on the industry-standard **GoTrue** API. Deploy secure social login, magic links, and multi-factor authentication across your entire organization with zero infrastructure management.

Identity Providers

Email & Magic Links

Standard password-based login or secure, passwordless magic links delivered via email.

OAuth Providers

Instantly enable social login with Google, GitHub, Slack, Discord, and dozens of others.

WebAuthn (Passkeys)

Coming soon. Modern, biometric-based passwordless authentication methods.

Implementation

Afribase provides a strongly-typed interface for managing authentication. Below are the core methods available in our SDKs (JavaScript, Python, Dart).

01

Sign Up / Sign In

Users can sign up for a new account or sign in with their existing credentials.

JavaScript

typescript
// Sign Up
const { data, error } = await afribase.auth.signUp({
  email: 'user@example.com',
  password: 'securePassword123'
});

// Sign In with Password
const { data, error } = await afribase.auth.signInWithPassword({
  email: 'user@example.com',
  password: 'securePassword123'
});

Python

python
# Sign Up
client.auth.sign_up(email="user@example.com", password="securePassword123")

# Sign In with Password
client.auth.sign_in_with_password(email="user@example.com", password="securePassword123")

Dart / Flutter

dart
// Sign Up
await client.auth.signUp(email: 'user@example.com', password: 'securePassword123');

// Sign In with Password
await client.auth.signInWithPassword(email: 'user@example.com', password: 'securePassword123');
02

Passwordless & OAuth

Send one-time passwords (OTP) or magic links, and handle Social Logins like Google or GitHub.

JavaScript

typescript
// Send OTP / Magic Link
await afribase.auth.signInWithOtp({ email: 'user@example.com' });

// Social Login
const { url } = await afribase.auth.signInWithOAuth({ provider: 'google' });

Python

python
# Send OTP / Magic Link
client.auth.sign_in_with_otp(email="user@example.com")

# Social Login
url = client.auth.sign_in_with_oauth(provider="google")

Dart / Flutter

dart
// Send OTP / Magic Link
await client.auth.signInWithOtp(email: 'user@example.com');

// Social Login
final url = await client.auth.signInWithOAuth(provider: 'google');
03

Session Management

Listen to authentication state changes across your application to handle navigation and session persistence.

JavaScript

typescript
afribase.auth.onAuthStateChange((event, session) => {
  console.log('Auth Event:', event); // 'SIGNED_IN', 'SIGNED_OUT'
});

Python

python
def on_auth_change(event, session):
    print(f"Auth state changed: {event}")

client.auth.on_auth_state_change(on_auth_change)

Dart

dart
client.auth.onAuthStateChange((event, session) => {
  print('Auth state changed to: $event');
});
Leverage our useAuthInactivity() hook in your React applications to automatically handle session expiration and redirect users to the sign-in page.

Global Policies

Organize users into **User Groups** and assign global permissions that dictate access across all services (Database, Storage, Edge Functions).

Access Control (RBAC)

Fine-grained Role Based Access Control for your entire organization.

© 2026 Afribase Cloud Infrastructure. Produced by Altris Product Systems.