Developers /

OAuth2 Integration

OAuth2 Integration

VeryAI's OAuth2 integration provides secure biometric authentication using a standard OAuth 2.0 / OpenID Connect flow while protecting user privacy through app-scoped identifiers rather than exposing raw biometric data.

Live Demo

See the OAuth2 flow in action with our interactive demo app.

Try Demo

When to Use OAuth2

  • Apps requiring persistent user identifiers for account linking or activity tracking
  • Organizations preferring familiar OAuth-style login flows
  • Use cases not requiring zero-knowledge proof anonymity

For maximum privacy without persistent identifiers, see ZK Integration instead.

Authentication Flow

The OAuth2 flow involves five steps:

  • 1. Authorization Request — Redirect users to VeryAI Connect with client credentials
  • 2. User Verification — Displays QR code for palm scanning via mobile app
  • 3. Authorization Code — Returned upon successful verification
  • 4. Token Exchange — Converts authorization code to access tokens
  • 5. API Access — Uses bearer tokens for protected resources

Base URL

https://api.very.org/oauth2

GET /authorize

Initiates the authorization flow. Verifies client_id, redirect_uri, and optional state. If valid, redirects the user to the consent/verification page.

Required Parameters

ParameterTypeDescription
response_typestringMust be "code"
client_idstringYour application's client ID
redirect_uriURIPre-registered redirect URI
scopestringMust include "openid". Add "offline_access" for refresh tokens.

Optional Parameters

ParameterTypeDescription
statestringOpaque value for CSRF protection
noncestringString value for replay protection

POST /token

Exchanges an authorization code for access tokens, or refreshes an existing token.

Parameters

ParameterTypeDescription
grant_typestring"authorization_code" or "refresh_token"
client_idstringYour application's client ID
client_secretstringYour application's client secret
codestringAuthorization code (required for authorization_code grant)
refresh_tokenstringRefresh token (required for refresh_token grant)
redirect_uriURIMust match the original request (required for authorization_code grant)

Response

FieldTypeDescription
access_tokenJWTAccess token (expires in 1 hour)
id_tokenJWTContains external_user_id in sub claim
token_typestringAlways "Bearer"
expires_inintegerToken lifetime in seconds
scopestringGranted scopes
refresh_tokenJWTRefresh token (~90 day expiry). Only when "offline_access" scope is granted.

GET /userinfo

Returns the user's persistent identifier. Requires a valid Bearer access token in the Authorization header.

Response

FieldTypeDescription
substringStable, pairwise identifier for the end user

Getting Started

Register your app and get credentials on the Getting Started page, or go directly to the Developer Portal.

VeryAI

Get the VeryAI app

Scan the QR code to download the app