Skip to content
  • Our Product
    • Namazu Elements
      • What is Elements?
      • Why open source?
      • Docs
        • Namazu 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

    • Best real-time game backends in 2026 If you're researching an alternative to your current backend solution, we've prepared a report of all of the backend solutions on the market in 2026 and how Namazu Elements compares.
      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

  • Namazu Elements in Five Minutes or Less
  • Accessing the Web UI (CMS)
  • CMS Feature Overview

Fundamentals

  • Why You Need a Server (and What “Authoritative” Means)
  • Elements as a Game Runtime
  • Where Your Authoritative Code Runs
  • Lifecycles and Flows

General Concepts

  • Overview
  • Custom Elements
  • Data Models
  • Security Model
  • N-Tier Architecture

Namazu Elements Core Features

  • User Authentication / Sign In
    • What is a User?
    • User Authentication in Elements
    • Email Verification
    • 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
    • Product Bundles and SKUs
    • Receipts
    • Reward Issuances
    • Save Data
    • Metadata
    • Metadata (3.4+)
    • Email Service
    • 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

Your Game Code - Adding Custom Elements

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

Configuration

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

RESTful APIs

  • Importing into Postman
  • RESTful APIs Library
  • Swagger and Swagger UI

Add-Ons

  • Crossplay
    • Namazu Crossfire (Multiplayer)
    • Deploying Namazu Crossfire in your game
  • Roblox
    • Roblox Overview
    • Secure Player Authentication & Registration
    • Global Matchmaking
    • Roblox Security Best Practices

Game Engine & Client Support

  • Unity
    • Elements Unity Plugin
    • Unity Crossfire Plugin

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
    • Running in the IDE
      • Exception in monitor thread while connecting to server localhost:27017
      • Could not deployAvailableApplications Jetty server Failed to bind to /0.0.0.0:8080 Address already in use

Releases

  • 3.6 Release Notes
  • 3.5 Release Notes
  • 3.4 Release Notes
  • 3.3 Release Notes
  • 3.2 Release Notes
  • 3.1 Release Notes
View Categories
  • Home
  • Docs
  • Namazu Elements Core Features
  • User Authentication / Sign In
  • Email Verification

Email Verification

Est. read time: 4 min read

Elements Version 3.8+

Elements supports email-based identity verification for user accounts. When a user’s email address is linked to their account via the email scheme, the address starts in the UNVERIFIED state. The verification flow confirms that the user controls that address.


Verification Lifecycle #

UNVERIFIED
    │
    │  POST /user/me/email/verify
    │  (EmailVerificationService.requestVerification)
    ▼
PENDING
    │
    │  GET /verify?token=<token>
    │  (EmailVerificationService.completeVerification)
    ▼
VERIFIED
StatusMeaning
UNVERIFIEDDefault state for a newly created email UID.
PENDINGVerification email has been sent; awaiting the user to click the link.
VERIFIEDUser has clicked the link and confirmed ownership of the address.

UIDs created via OIDC or OAuth2 providers are set to VERIFIED immediately – the external provider is the trusted verifier.


REST Endpoints #

Request verification #

POST /user/me/email/verify
Authorization: Bearer <session-secret>
Content-Type: application/json

{
  "email": "user@example.com"
}

Sends a verification link to the given address if it is linked to the authenticated user’s account. Moves the UID status from UNVERIFIED to PENDING. Returns the updated UserUid.

Responses

StatusCondition
200Verification email sent; UID is now PENDING.
400SMTP is not configured (see Email Service).
403Not authenticated, or the email does not belong to the current user.
404The email address is not linked to the account.

Complete verification #

GET /verify?token=<token>

Public endpoint – no authentication required. Consumes the single-use token from the email link and moves the UID status from PENDING to VERIFIED. Returns the updated UserUid.

Responses

StatusCondition
200Token accepted; UID is now VERIFIED.
404Token is unknown, already used, or expired (24-hour TTL).

Security model #

  • Single-use: the token is deleted immediately on first successful use. Clicking the link twice returns 404.
  • Time-limited: tokens expire after 24 hours. MongoDB removes expired token documents automatically via a TTL index on the expiry field.
  • Cryptographically random: the token is a UUID v4 generated by SecureRandom (122 bits of entropy). A database-native ObjectId was deliberately avoided because it encodes a timestamp, machine ID, and counter, making it partially predictable.

Service interface #

package dev.getelements.elements.sdk.service.user;

public interface EmailVerificationService {

    /** Fired on requestVerification; carries the updated UserUid (status PENDING). */
    String EMAIL_VERIFICATION_REQUESTED_EVENT = "dev.getelements.email_verification.requested";

    /** Fired on completeVerification; carries the updated UserUid (status VERIFIED). */
    String EMAIL_VERIFICATION_COMPLETED_EVENT = "dev.getelements.email_verification.completed";

    UserUid requestVerification(String email, String verificationBaseUrl);

    UserUid completeVerification(String token);
}

Element attributes #

Attribute keyDefaultDescription
dev.getelements.elements.verification.base_url(blank – derived from request)Override the base URL embedded in the link, e.g. when sitting behind a reverse proxy.
dev.getelements.elements.verification.email_subjectVerify your emailSubject line for the verification email.
dev.getelements.elements.verification.email_template(inline link – see below)Full HTML body. Must contain {link} as the placeholder for the verification URL.

Default email template #

<p>Please verify your email address by clicking the link below:</p>
<p><a href="{link}">Verify Email</a></p>

Custom template example #

Override VERIFICATION_EMAIL_TEMPLATE in your Element’s Guice module or via element attributes:

public class MyGameElementModule extends AbstractModule {
    @Override
    protected void configure() {
        bindConstant()
            .annotatedWith(Names.named(EmailVerificationService.VERIFICATION_EMAIL_TEMPLATE))
            .to("<html><body>"
              + "<h1>Confirm your email</h1>"
              + "<p><a href=\"{link}\">Click here to verify</a></p>"
              + "</body></html>");
    }
}

The {link} token is always replaced with the full verification URL before the email is sent.


Using EmailVerificationService in custom Elements #

EmailVerificationService is exported to element child injectors. Inject it to trigger verification programmatically on behalf of any user:

import dev.getelements.elements.sdk.service.user.EmailVerificationService;
import jakarta.inject.Inject;
import jakarta.inject.Named;

import static dev.getelements.elements.sdk.service.Constants.UNSCOPED;

public class MyOnboardingService {

    private EmailVerificationService emailVerificationService;

    public void sendVerification(String email) {
        // UNSCOPED skips the current-user ownership check
        emailVerificationService.requestVerification(email, "https://mygame.com/api/rest/verify");
    }

    @Inject
    @Named(UNSCOPED)
    public void setEmailVerificationService(EmailVerificationService emailVerificationService) {
        this.emailVerificationService = emailVerificationService;
    }
}

Note: The @Named(UNSCOPED) qualifier is needed when calling requestVerification from Element code on behalf of any user. Without it, the USER-scoped service is used, which checks that the email belongs to the current session user.


Prerequisites #

Email sending requires SMTP to be configured at the platform level. See Email Service for the full configuration reference.


Events #

Both events carry a UserUid argument accessible from element event listeners.

elementRegistry.onEvent(event -> {
    if (EmailVerificationService.EMAIL_VERIFICATION_COMPLETED_EVENT.equals(event.getEventName())) {
        final var uid = (UserUid) event.getArguments().get(0);
        // uid.getVerificationStatus() == VerificationStatus.VERIFIED
    }
});
What are your Feelings
Still stuck? How can we help?

How can we help?

Updated on April 8, 2026
User Authentication in ElementsWhat is a User?
Table of Contents
  • Verification Lifecycle
  • REST Endpoints
    • Request verification
    • Complete verification
  • Security model
  • Service interface
  • Element attributes
    • Default email template
    • Custom template example
  • Confirm your email
    • Using EmailVerificationService in custom Elements
    • Prerequisites
    • Events
  • Documentation
  • Terms of Service
  • Privacy Policy
  • Contact us
  • Linkedin
  • Join our Discord

Namazu Studios LLC is powered by Namazu Elements, an open source modular backend framework for connected games.

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

©2008-2026 Namazu Studios. All Rights Reserved.