Secure OAuth 2.0 and OpenID Connect (OIDC) integration for your custom website
This document explains how to integrate Authentiq8 Me as a login provider for your custom website using the OAuth 2.0 and OpenID Connect (OIDC) standard. Users will authenticate via Authentiq8 Me and your website will receive an ID token containing user details.
Users authenticate via Authentiq8 Me and your website receives verified user data without handling passwords.
Login to your Authentiq8 Me control panel to register your website as an OAuth client. You'll receive the following credentials:
Make sure your redirect URIs are exact matches. Even a trailing slash can cause authentication to fail.
When the user clicks "Login with Authentiq8 Me," redirect them to Authentiq8 Me's authorization endpoint:
https://api.authentiq8.me/oauth/authorize.php
Parameter | Example | Notes |
---|---|---|
client_id | your client ID | From registration |
response_type | code | Required for OAuth flow |
scope | openid email profile phone | Only request data you truly need |
redirect_uri | your callback URL | Must exactly match what's registered |
state | random string | CSRF protection |
Example URL:
https://api.authentiq8.me/oauth/authorize.php?
client_id=fd9727a6-f5c8-a7fe-9ca9-82118e841031&
response_type=code&
scope=openid%20email%20profile%20phone&
redirect_uri=https%3A%2F%2Fyoursite.com%2Foauth%2Fcallback.php&
state=xyzABC123
Always include the state
parameter to prevent CSRF attacks. Generate a unique, unpredictable value for each request.
Only request the scopes you absolutely need. More scopes may lead to lower user consent rates.
The user completes the following authentication flow:
User enters their email address
User receives a push notification from Authentiq8 Me
User approves login via biometrics/PIN
After successful authentication, Authentiq8 Me redirects the user back to your specified callback URL with an authorization code:
https://yoursite.com/oauth/callback.php?code=XXXX&state=xyzABC123
If the user has the Authentiq8 Me app installed on their device, they'll be seamlessly redirected to the app for authentication.
The authorization code is short-lived (typically 5-10 minutes). Your backend should exchange it for tokens immediately.
Your backend now makes a POST request to the token endpoint to exchange the authorization code for tokens:
https://api.authentiq8.me/oauth/token.php
Parameter | Value |
---|---|
client_id | your client ID |
client_secret | your client secret |
code | the authorization code from step 3 |
redirect_uri | must match the one used earlier |
Example php request:
<?php
$url = 'https://api.authentiq8.me/oauth/token.php';
$data = [
'client_id' => 'fd9727a6-f5c8-a7fe-9ca9-82118e841031',
'client_secret' => 'YOUR_SECRET',
'code' => 'XXXXXX',
'redirect_uri' => 'https://yoursite.com/oauth/callback.php'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Example response:
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"id_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}
This step must be performed server-to-server. Never include your client_secret in client-side code or expose it to end users.
The ID Token is a JWT signed with RS256. You must validate:
Verify using Authentiq8 Me's public keys
Must match your client_id
Must match https://api.authentiq8.me/oauth
Token must not be expired
Authentiq8 Me JWKS endpoint for public keys:
https://api.authentiq8.me/oauth/.well-known/jwks.php
Example decoded ID Token payload:
{
"sub": "2aed8987-d590-861d-cf52-92d95d115986",
"email": "joe@aq8.me",
"name": "Joe Styles",
"iat": 1751031077,
"exp": 1751034677,
"iss": "https://api.authentiq8.me/oauth"
}
Use established JWT libraries for your programming language to handle validation:
jsonwebtoken
jjwt
PyJWT
System.IdentityModel.Tokens.Jwt
After successful validation, you can use the claims from the ID token to:
Create a session for the authenticated user
If this is the user's first login
Save needed user data (e.g. email, name)
The sub
claim is the stable unique identifier for the user. Use this rather than email for mapping users in your system.
Match returning users by the sub
claim rather than email, as emails can change.
The email in the ID token is already verified by Authentiq8 Me. No additional verification needed.
Users may decline to share some requested information. Your application should handle these cases gracefully:
null
Never deny access solely because optional claims are missing. Only enforce requirements for truly essential data.
Respect user privacy by only requesting data you absolutely need and clearly explaining why each piece of information is required.
Consider collecting non-essential user data later in your application flow rather than at initial login.
Your website initiates the flow
User is sent to Authentiq8 Me
Using biometrics or PIN
To your callback URL
Server-to-server request
Create session with user data