Add Login with Akdira Account to your app
Akdira Account is a standard OpenID Connect provider backed by the Akdira directory (OpenLDAP). Any app or library that supports “Sign in with Microsoft / Google”-style OIDC works with it — people sign in once with their @akdira.id account.
1Register your app
An Akdira admin registers the app under Apps (redirect URI, platform). You receive a Client ID and — for server-side web apps — a Client secret. Single-page and mobile apps are registered as public clients and must use PKCE.
2Add the button
Copy-paste ready HTML (no external CSS needed). Point href at the route in your app that starts the sign-in.
<a href="/auth/akdira" style="display:inline-flex;align-items:center;gap:12px;height:41px;padding:0 12px;background:#fff;color:#5e5e5e;border:1px solid #8c8c8c;border-radius:4px;font:600 15px 'Segoe UI',system-ui,-apple-system,sans-serif;text-decoration:none">
<svg width="21" height="21" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="akdira-btn-g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#7c3aed"/><stop offset="1" stop-color="#06b6d4"/></linearGradient></defs><rect width="32" height="32" rx="8" fill="url(#akdira-btn-g)"/><path d="M16 6.5 8 25.5h4.2l1.6-4.2h4.4l1.6 4.2H24L16 6.5zM14.2 18.3 16 13.2l1.8 5.1z" fill="#fff" fill-rule="evenodd"/></svg>
<span>Login with Akdira Account</span>
</a><a href="/auth/akdira" style="display:inline-flex;align-items:center;gap:12px;height:41px;padding:0 12px;background:#2f2f2f;color:#fff;border:1px solid #2f2f2f;border-radius:4px;font:600 15px 'Segoe UI',system-ui,-apple-system,sans-serif;text-decoration:none">
<svg width="21" height="21" viewBox="0 0 32 32" aria-hidden="true"><defs><linearGradient id="akdira-btn-g" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#7c3aed"/><stop offset="1" stop-color="#06b6d4"/></linearGradient></defs><rect width="32" height="32" rx="8" fill="url(#akdira-btn-g)"/><path d="M16 6.5 8 25.5h4.2l1.6-4.2h4.4l1.6 4.2H24L16 6.5zM14.2 18.3 16 13.2l1.8 5.1z" fill="#fff" fill-rule="evenodd"/></svg>
<span>Login with Akdira Account</span>
</a>Prefer an image? login-with-akdira-light.svg · login-with-akdira-dark.svg
3Configure your OpenID Connect library
| Issuer | https://account.akdira.id |
|---|---|
| Discovery | https://account.akdira.id/.well-known/openid-configuration |
| Authorization | https://account.akdira.id/oauth2/authorize |
| Token | https://account.akdira.id/oauth2/token |
| UserInfo | https://account.akdira.id/oauth2/userinfo |
| JWKS | https://account.akdira.id/oauth2/jwks |
| Logout (end session) | https://account.akdira.id/oauth2/logout |
| Revocation | https://account.akdira.id/oauth2/revoke |
| Flow | Authorization Code (+ PKCE S256). Refresh tokens with the offline_access scope. |
| Client authentication | client_secret_basic, client_secret_post or none (public + PKCE) |
| Signing | RS256 (keys at the JWKS endpoint) |
Node.js (openid-client)
// npm install openid-client express express-session
import * as oidc from 'openid-client';
const config = await oidc.discovery(
new URL('https://account.akdira.id'),
process.env.AKDIRA_CLIENT_ID,
process.env.AKDIRA_CLIENT_SECRET,
);
// 1) "Login with Akdira Account" button → /auth/akdira
app.get('/auth/akdira', async (req, res) => {
const verifier = oidc.randomPKCECodeVerifier();
const state = oidc.randomState();
req.session.akdira = { verifier, state };
res.redirect(oidc.buildAuthorizationUrl(config, {
redirect_uri: 'https://your-app.example.com/auth/akdira/callback',
scope: 'openid profile email groups',
code_challenge: await oidc.calculatePKCECodeChallenge(verifier),
code_challenge_method: 'S256',
state,
}).href);
});
// 2) Callback: exchange the code, read the verified ID token claims
app.get('/auth/akdira/callback', async (req, res) => {
const { verifier, state } = req.session.akdira;
const tokens = await oidc.authorizationCodeGrant(config, new URL(req.originalUrl, 'https://your-app.example.com'), {
pkceCodeVerifier: verifier,
expectedState: state,
});
const user = tokens.claims(); // { sub, name, email, preferred_username, groups, ... }
req.session.user = user;
res.redirect('/');
});Python (Authlib)
# pip install authlib flask
from authlib.integrations.flask_client import OAuth
oauth = OAuth(app)
oauth.register(
name="akdira",
server_metadata_url="https://account.akdira.id/.well-known/openid-configuration",
client_id=AKDIRA_CLIENT_ID,
client_secret=AKDIRA_CLIENT_SECRET,
client_kwargs={"scope": "openid profile email groups", "code_challenge_method": "S256"},
)
@app.route("/auth/akdira")
def login():
return oauth.akdira.authorize_redirect(url_for("callback", _external=True))
@app.route("/auth/akdira/callback")
def callback():
token = oauth.akdira.authorize_access_token()
session["user"] = token["userinfo"]
return redirect("/")Odoo
Odoo's built-in OAuth Authentication only supports the legacy implicit flow. Use the OCA module auth_oidc with
Auth Flow: Authorization Code Flow with PKCE, Authorization URL https://account.akdira.id/oauth2/authorize,
Token URL https://account.akdira.id/oauth2/token, JWKS URL https://account.akdira.id/oauth2/jwks, scope openid profile email and token map sub:user_id.
Scopes & claims
| Scope | The user sees |
|---|---|
openid | Sign you in with your Akdira Account |
profile | Read your basic profile (name, job title, department, photo) |
email | Read your email address |
phone | Read your phone number |
groups | Read the groups you belong to |
offline_access | Keep access to the data you gave it access to, even when you are not using it |
| Claim | Scope | Description |
|---|---|---|
sub | openid | Stable, unique account ID (never changes, even if the username does) |
name / given_name / family_name | profile | Display name and name parts |
preferred_username | profile | Username, e.g. akmal |
upn | profile | Sign-in name, e.g. akmal@akdira.id |
job_title / department | profile | From the directory |
picture | profile | Profile photo URL (when set) |
email / email_verified | email | Directory email address (always verified) |
phone_number | phone | Mobile or work phone |
groups | groups | Directory groups, e.g. ["admins","engineering"] |
Claims are included in both the ID token and the UserInfo response. Disabled accounts cannot sign in and their tokens stop resolving at the UserInfo endpoint.