Skip to content
  • Our Product
    • Namazu Elements
      • What is Elements?
      • Why open source?
      • Docs
        • Elements in Five Minutes or Less
        • RESTful APIs Library
        • Security Model
        • Accessing the Web UI (CMS)

    Our Product

    A logomark with three layered rhombuses adorning the lettermark that says Elements in bold all-caps sans-serif letters.
    • What is Namazu Elements? Discover our easy-to-use backend network solution built for online games. Rapidly enables full-scale multiplayer games or online solo adventures.
    • Why open source? Is there a truly open source server backend for connected games? There is now. Download and run a local copy of Namazu Elements and try it for yourself.
    Download Namazu Elements

    Get started

    • Quick start Read our Elements 5-minute quick start guide
    • Documentation Read our developer docs for learning more about Elements
    • RESTful APIs A full list of core API specs for working with the Elements framework
    • Security An overview of the server-authoritative security model of Elements
    • Accessing the CMS Manage your game with ease via the Namazu Elements CMS.

    Co-development Reimagined

    • Reduce your costs Would you rather outsource your backend development? Hire Namazu Studios to build your server backend with the power of Namazu Elements.
      Co-dev

    Recent Posts

    • The watercolor-styled Namazu Studios logo over a giant namazu lurking in the depth
      Namazu Studios Featured in San Diego Business Journal
      22 Sep 2025 Press
    • Namazu Elements 3.1 Released – Service Layer Fixes, Secure APIs, and Steam Bug Fix
      22 Apr 2025 Release Notes
  • Case Studies
  • About Us
  • News
  • Services
  • Book a call
namazu-studios-logo
Book a call

Getting Started

  • Elements in Five Minutes or Less
  • Accessing the Web UI (CMS)
  • General Concepts
  • N-Tier Architecture
  • Security Model

Namazu Elements Core

  • User Authentication / Sign In
    • What is a User?
    • User Authentication in Elements
    • Auth Schemes
      • Auth Schemes
      • OAuth2
      • OIDC
  • Features
    • Applications
    • Sessions
    • Users and Profiles
    • Digital Goods
    • Progress and Missions
    • Progress and Missions (3.4+)
    • Leaderboards
    • Matchmaking – Comprehensive Guide
    • Followers
    • Friends
    • Receipts
    • Reward Issuance
    • Save Data
    • Metadata
    • Metadata (3.4+)
    • Queries
    • Web3
      • Wallets
      • Vaults
      • Omni Chain Support
      • Smart Contracts
        • Smart Contracts
  • Queries
    • Advanced Operators
    • Object Graph Navigation
    • Boolean Queries
    • Base Query Syntax
  • Advanced Operators
    • .name
    • .ref

Custom Code

  • Custom Code Overview
  • Windows Setup
  • Mac OS Setup
  • Ubuntu Linux Setup
  • Introduction to Guice and Jakarta in Elements
  • Structuring your Element
  • Packaging an Element with Maven
  • Deploying an Element
  • Preparing for code generation
  • Properties
  • Websockets
  • RESTful APIs
  • Direct MongoDB Access (3.5+)

Releases

  • 3.5 Release Notes
  • 3.4 Release Notes
  • 3.3 Release Notes
  • 3.2 Release Notes
  • 3.1 Release Notes

Configuration

  • Matchmaking – Comprehensive Guide
  • Direct Database Access and Batch Configuration
  • Batch Samples
    • Mission Upload Bash Script Sample
    • Item Upload Bash Script Sample

RESTful APIs

  • RESTful APIs Library
  • Swagger and Swagger UI

Add-Ons

  • Custom Elements
    • Crossplay
      • Namazu Crossfire (Multiplayer)
      • Deploying Namazu Crossfire in your game
  • Game Engines
    • Unity
      • Elements Codegen
      • Crossfire
    • Roblox
      • Roblox Overview
      • Secure Player Authentication & Registration
      • Global Matchmaking
      • Roblox Security Best Practices

Troubleshooting

  • Common Issues with Docker
  • Local SDK
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
    • Could not load class : java.lang.NoClassDefFoundError
  • Namazu Elements Community Edition
    • Common Issues with Docker
    • Unable to deploy application : dev.getelements.elements.sdk.exception.SdkElementNotFoundException
View Categories
  • Home
  • Docs
  • Namazu Elements Core
  • User Authentication / Sign In
  • User Authentication in Elements

User Authentication in Elements

Est. read time: 3 min read

Elements provides multiple ways to create and authenticate users, depending on your needs. You can use simple username/email + password logins, or integrate with third-party identity providers like Google or Steam via OIDC and OAuth2.


Authentication Methods #

1. Password Users #

The most straightforward approach: create an account with a username/email and a password.

There are two ways to create password-based users:

  • Admin creation (requires SUPERUSER session token):
    • POST /api/rest/users
    • Used by administrators to manually create users.
    • Must include a valid session token with SUPERUSER privileges.
  • Public signup (no authentication required):
    • POST /api/rest/signup
    • End users can sign up themselves with just a username/email and password.
    • No prior authentication required.

Once created, users can log in with their credentials and receive a session token.


2. OIDC (OpenID Connect) with JWTs #

OIDC lets users authenticate with external providers (like Google) using JWTs (JSON Web Tokens).

Setup steps:

  1. Create an Auth Scheme for the provider:
    • Give it a name (e.g. Google).
    • Provide the JWK URL (JSON Web Key Set) from the provider.
  2. When a user tries to log in:
    • The client sends the JWT obtained from the provider to Elements.
    • Elements uses the JWK to verify the token’s signature.
    • If valid:
      • A user account is created automatically if one doesn’t already exist.
      • A session token is returned.

Key point: OIDC login requires no password handling on your end. Elements verifies identity using the provider’s JWT.


3. OAuth2 (Customizable) #

OAuth2 is a flexible alternative to OIDC, useful for providers like Steam that don’t offer standard OIDC.

Setup steps:

  1. Create an Auth Scheme:
    • Name (e.g. Steam).
    • Validation URL (where Elements verifies the token).
    • User ID property (the field in the validation response that maps to a user ID, e.g. steamid).
    • Custom headers or query parameters (if the provider requires them).
    • Specify whether parameters are:
      • Sent by the frontend (dynamic, provided per login request), or
      • Pre-set in the auth scheme (static, stored securely).
  2. Login flow:
    • The frontend collects the OAuth2 token from the provider.
    • Sends it to Elements along with the scheme name.
    • Elements calls the validation URL, passes required headers/params, and checks the response.
    • If valid:
      • A user is created if needed.
      • A session token is returned.

Quick Comparison #

MethodWhen to UseRequirementsFlow
PasswordSimple accounts with username/email + passwordAdmin token (for manual creation) OR none (for signup)POST request to Elements; returns session token
OIDCStandard identity providers (Google, Apple, etc.)Create Auth Scheme with JWK URLClient provides JWT → Elements verifies → returns session token
OAuth2Providers without OIDC (Steam, custom services)Create Auth Scheme with validation URL, user ID mapping, headers/paramsClient provides token → Elements validates → returns session token

Best Practices #

  • Use OIDC when possible — it’s simpler and more standardized than custom OAuth2.
  • For password users, prefer the public signup endpoint to avoid handling SUPERUSER tokens unnecessarily.
  • Keep Auth Scheme configs secure. Only expose parameters the frontend needs to send dynamically.
  • Treat session tokens like sensitive credentials — they grant access to the user’s account.

See Also #

  • Elements API Reference: /api/users
  • Elements API Reference: /api/signup
  • Auth Scheme Configuration

What are your Feelings
Still stuck? How can we help?

How can we help?

Updated on August 25, 2025
What is a User?
Table of Contents
  • Authentication Methods
    • 1. Password Users
    • 2. OIDC (OpenID Connect) with JWTs
    • 3. OAuth2 (Customizable)
  • Quick Comparison
  • Best Practices
  • See Also
  • Documentation
  • Terms of Service
  • Privacy Policy
  • Contact us
  • Linkedin
  • Join our Discord

Namazu Studios LLC is powered by Namazu Elements, an Elemental Computing Inc. product.

Elements
  • Download
  • About Elements
  • Open source
  • Documentation
  • Support
About Namazu
  • Case Studies
  • About Us
  • News
Get in Touch
  • info@namazustudios.com
  • Book a call
  • (619) 862-2890
  • Linkedin
  • Discord

©2008-2025 Namazu Studios. All Rights Reserved.