A test/demo module for auth_jwt.
auto_awesome What this module does
AI-generated from the code · Odoo 18.0Demo/test module that adds sample web endpoints to try out JWT authentication in Odoo, returning the logged-in user's name and email as JSON.
This is a demonstration module built on top of the JWT authentication module. It does not add menus or screens; instead it exposes a few web addresses (endpoints) that return information about the user identified by a JSON Web Token (JWT), a signed token used to prove identity.
/auth_jwt_demo/whoamireturns the name and email of the partner linked to the token, plus the user id./auth_jwt_demo/whoami-public-or-jwtworks either with a valid token or anonymously, returning the user id and, when a token is present, the partner's name and email./auth_jwt_demo_cookie/whoamiand/auth_jwt_demo_cookie/whoami-public-or-jwtdo the same but accept the token stored in a cookie./auth_jwt_demo/keycloak/whoamiand/auth_jwt_demo/keycloak/whoami-public-or-jwtare meant to be used with a Keycloak identity provider; the public version returns "Anonymous" when no token is supplied.
All responses are JSON and the endpoints allow cross-origin requests. The module also loads demo data: three JWT validators named demo, demo_cookie and demo_keycloak, configured with an audience, an issuer, a signing secret or public key, and rules that pick the Odoo user and partner from the token. These are sample configurations for testing, not production settings.
Depends on
Required by other modules
Text generated by AI (DeepSeek) from reading the Odoo 18.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 4 confirmed, 5 with no information of 9 versions.
Sources · Odoo 18.0
Confirmed on 2026-11-03 in branch 18.0 of OCA/server-auth.
terminal Installation and usage
OCA documentation · Odoo 18.0Usage
Source · Odoo 18.0This modules creates a JWT validator named demo, and adds a /auth_jwt_demo/whoami route which returns information about the partner identified in the token.
The whoami endpoint can be invoked as such, assuming python-jose is installed.
# /usr/bin/env python3
import time
import requests
from jose import jwt
token = jwt.encode(
{
"aud": "auth_jwt_test_api",
"iss": "some issuer",
"exp": time.time() + 60,
"email": "mark.brown23@example.com",
},
key="thesecret",
algorithm=jwt.ALGORITHMS.HS256,
)
r = requests.get(
"http://localhost:8069/auth_jwt_demo/whoami",
headers={"Authorization": "Bearer " + token},
)
r.raise_for_status()
print(r.json())No verified information in OCA: Installation, Configuration.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.