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
Popular Search Roblox

Getting Started

  • Namazu Elements in Five Minutes or Less
  • Overview
  • 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

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

Namazu Elements Core Features

  • Email Service
  • Applications
  • Sessions
  • Users and Profiles
  • Digital Goods
  • Progress and Missions
  • Progress and Missions (3.4+)
  • Leaderboards
  • Matchmaking – Comprehensive Guide
  • Friends
  • Followers
  • Product Bundles and SKUs
  • Item Ledger
  • Receipts
  • Reward Issuances
  • Save Data
  • Metadata
  • Metadata (3.4+)
  • Queries
  • User Authentication / Sign In
    • What is a User?
    • Email Verification
    • User Authentication in Elements
    • Account Linking
    • Setting Up Twitch OIDC Login (Backend)
    • OIDC Login for Thick Clients (Browser Redirect Flow)
    • Auth Schemes
      • Auth Schemes
      • OAuth2
      • OIDC
  • Features
    • 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+)
  • Building the Example Element: A Complete Walkthrough
  • Building the Kotlin Example Element: A Complete Walkthrough

Configuration

  • Configuring External URLs for Deployment
  • Matchmaking – Comprehensive Guide
  • Direct Database Access and Batch Configuration
  • Connecting Namazu Elements to a TLS-Enabled MongoDB Replica Set
  • 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
    • Crossfire Client Libraries (JVM & Browser)
    • Crossfire Protocol Reference
    • Crossfire: Custom Matchmaking Algorithms
    • Namazu Crossfire (Multiplayer)
    • Deploying Namazu Crossfire in your game
  • Roblox
    • Roblox Overview
    • Secure Player Authentication & Registration
    • Global Matchmaking
    • Roblox Security Best Practices
  • Container on Demand
    • Namazu Conductor
    • Namazu Conductor Admin API
    • Configuring Namazu Conductor Providers
  • Commerce
    • Stripe
      • Stripe
      • Configuring the Stripe Element
      • Stripe REST API Reference
      • Stripe REST API Reference

Game Engine & Client Support

  • Unity
    • Elements Unity Plugin
    • Unity Crossfire Plugin
  • Gamemaker
    • Incorporating GMEXT-Elements into a GameMaker Project

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.8 Release Notes
  • 3.7 Release Notes
  • 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
  • Account Linking

Account Linking

Est. read time: 2 min read

AI Doc Summarizer Doc Summary
AI Doc Summarizer Thinking Thinking

Linking attaches an additional identity — an OAuth2 provider, an OIDC provider, or an email/username and password — to a User that already has an active Session. It’s a separate, explicit action from logging in, and it’s the only way to combine two identities into one account.

Note

Logging in via OIDC or OAuth2 never merges into a Session you already have. Login resolves purely from the token’s claims — if the provider identity has been seen before, it signs into that User; if not, it creates a brand-new User. So if you create an anonymous Session via Signup and then log in with, say, Twitch, you get a second, unrelated account, not your original anonymous account with Twitch attached. To attach Twitch to the anonymous account instead, call the linking endpoints below while the anonymous Session is still active, rather than logging in with Twitch directly.

Precondition: an active User Session #

Every linking endpoint requires the caller to already hold a Session at the User or SUPERUSER level (an anonymous/UNPRIVILEGED Session doesn’t qualify). Calling any of them without one returns a 403 Forbidden — “Authentication required to link accounts” for OAuth2/OIDC, “Authentication required to link credentials” for email/username-password. The identity is always attached to the User making the request; there’s no way to link on behalf of another User.

Endpoints #

POST /User/me/link/OAuth2 #

Links an OAuth2 identity, validated the same way an OAuth2 login is. Request body:

{
  "schemeId": "<OAuth2 auth scheme id>",
  "requestParameters": { "...": "..." },
  "profileId": "<optional>",
  "profileSelector": "<optional>"
}

If the external id is already linked to a different User, the request fails. If it’s already linked to the calling User, the call is Idempotent — no duplicate link is created. On success it returns a full Session, the same as a login call.

POST /User/me/link/OIDC #

Links an OIDC identity from a JWT. Request body:

{
  "JWT": "<id_token>",
  "profileId": "<optional>",
  "profileSelector": "<optional>"
}

If the token’s sub is already linked to a different User, the request fails. If the token’s email claim is already linked to a different User, that’s handled more leniently: the sub still links successfully, and the email simply isn’t attached (no error). Linking this way does capture the provider’s returned Profile claims into User.linkedAccountProfiles, the same audit trail described in Users and Profiles — but unlike a fresh anonymous login, it does not fill in the flat displayName/firstName/lastName fields.

POST /User/me/link/email-password #

{
  "email": "User@example.com",
  "password": "..."
}

The email must already exist as a verified email UID on the calling User — see Email Verification for how to verify one first. If the email belongs to a different account, the request is rejected. On success it sets the password and returns the updated User.

POST /User/me/link/username-password #

{
  "username": "...",
  "password": "..."
}

If the calling User already has a different name set, this is rejected — name changes have to go through an explicit update, not linking. If the requested username is already taken by another User, it’s rejected as well. Otherwise it claims the username and sets the password, returning the updated User.

What happens on a conflict #

In every case, an identity already linked to another User is rejected rather than silently reassigned or merged — Elements never combines two existing accounts into one by linking. If you need one physical player to end up with a single account after using two different identities independently, that has to be handled as a deliberate migration, not a linking call.

An identity already linked to the same User that’s making the request is treated as a no-op success rather than an error, so clients don’t need to check “is this already linked?” before calling these endpoints.

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

How can we help?

Updated on August 14, 2026
User Authentication in ElementsSetting Up Twitch OIDC Login (Backend)
Table of Contents
  • Precondition: an active User session
  • Endpoints
    • POST /user/me/link/oauth2
    • POST /user/me/link/oidc
    • POST /user/me/link/email-password
    • POST /user/me/link/username-password
  • What happens on a conflict
  • 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.