
多种认证方式
支持邮箱、匿名游客账号、Apple Sign-In 和 Google OAuth。玩家自由选择登录方式。
基于角色的访问控制
通过角色分配来控制每位用户的操作权限,内置管理员和玩家角色体系。
跨平台会话
玩家只需登录一次,即可在所有设备上无缝保持登录状态。
开箱即用的 App Store 合规
horizOn User Management 现在支持 Sign in with Apple。只需注册一次 Team ID、Services ID 和 Bundle ID。你的 iOS 构建会立即符合要求。
快速集成
MyGame 认证
欢迎回来,玩家
// Unity C#: User Authentication
using PM.horizOn.Cloud.Core;
using PM.horizOn.Cloud.Manager;
using UnityEngine;
// Once at startup: reads the imported horizOn config (API key and hosts)
HorizonApp.Initialize();
await new HorizonServer().Connect();
// Sign up with email (true on success)
bool created = await UserManager.Instance.SignUpEmail(
"player@example.com", "securePassword", "PlayerOne");
// Sign in on a later start
bool signedIn = await UserManager.Instance.SignInEmail("player@example.com", "securePassword");
// Or start as a guest without an email
bool guest = await UserManager.Instance.SignUpAnonymous("GuestPlayer");
Debug.Log($"Player id: {UserManager.Instance.CurrentUser.UserId}");# REST API: User Authentication
# Sign up with email
curl -X POST https://horizon.pm/api/v1/app/user-management/signup \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"EMAIL","email":"player@example.com","password":"securePassword","username":"PlayerOne"}'
# Sign in with email (the reply holds userId and accessToken, the player's session token)
curl -X POST https://horizon.pm/api/v1/app/user-management/signin \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"EMAIL","email":"player@example.com","password":"securePassword"}'
# Anonymous sign up (guest account)
curl -X POST https://horizon.pm/api/v1/app/user-management/signup \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"type":"ANONYMOUS","username":"GuestPlayer"}'这些示例使用 Unity SDK(C#)和 REST API。Godot 和 Unreal 在各自的 SDK 中有相同的调用: 参见快速入门




