# FiveM player identifiers: license, license2, discord and steam

> Every FiveM player identifier and when it exists: license, license2, discord, fivem, steam and ip. Read them with GetPlayerIdentifiers, ban on tokens too.

Source: https://fam-tools.com/guides/fivem-player-identifiers · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 9 min

**Short answer.** FiveM provides `license` (Rockstar licence, always present), `license2` (the ROS licence for Steam users; can equal `license`), `discord` (if Discord is running and linked), `fivem` (if logged in to Cfx.re), `steam` (only with a `steam_webApiKey` set and Steam running) and `ip`. Read them with `GetPlayerIdentifiers(src)` or `GetPlayerIdentifierByType(src, 'license')`. Use `license` as the stable key; add tokens (`GetPlayerToken`) for bans.

## Key points

- `license` is the reliable primary identifier.
- `discord`, `fivem`, `steam` can be missing.
- `steam` needs `steam_webApiKey` in server.cfg.
- `GetPlayerIdentifierByType` for one; `GetPlayerIdentifiers` for all.
- IPs are personal data — store only what you need.

Every connected player comes with a set of identifiers — strings like `license:1a2b…` and `discord:1234…`. They are how you save characters, give staff permissions and ban cheaters. Knowing which ones are always present, and which only sometimes, prevents a whole class of bugs.

## The identifier types

*From Cfx.re’s GetPlayerIdentifiers documentation. You may also see Microsoft (`xbl`, `live`) identifiers.*

| Type | Source | Always present? | Example |
| --- | --- | --- | --- |
| `license` | Rockstar (ROS) licence hash | Yes | `license:1a2b3c…` |
| `license2` | ROS licence for Steam users | Usually; may equal `license` | `license2:…` |
| `discord` | Discord user ID | Only if Discord is running and linked | `discord:123456789012345678` |
| `fivem` | Cfx.re account ID | Only if logged in to Cfx.re | `fivem:1234567` |
| `steam` | Steam ID (hex) | Only with `steam_webApiKey` and Steam running | `steam:11000010…` |
| `ip` | IP address | Yes | `ip:203.0.113.7` |

## Reading identifiers

*server.lua*

```lua
local license = GetPlayerIdentifierByType(src, 'license')   -- 'license:…' or nil
local discord = GetPlayerIdentifierByType(src, 'discord')

-- all of them as a table keyed by type
local ids = {}
for _, id in ipairs(GetPlayerIdentifiers(src)) do
    local kind = id:match('^(%w+):')
    ids[kind] = id
end
```

Identifiers are available from `playerConnecting` onward (with the temporary source), so whitelists and bans can check them before the player loads.

## Which identifier to store

Use `license` as the account key — every player has one. Frameworks do the same (ESX’s `identifier`, QBCore’s `license` column). Store `discord` as an extra field for staff tools and whitelists, not as the primary key, because it disappears when Discord is closed.

## Identifiers and bans

A new Rockstar account gives a new licence, so bans that check only `license` are easy to evade. Store every identifier plus the player’s tokens (`GetNumPlayerTokens` / `GetPlayerToken`) and match any of them — see [ban systems](https://fam-tools.com/guides/fivem-ban-system).

## Privacy

IP addresses and account IDs are personal data in many jurisdictions. Store only what you use, restrict who can see it (not every moderator needs IPs), and delete old logs.

## Questions

### What is the license identifier in FiveM?

A hash of the player’s Rockstar licence. Every player has one, which makes it the best primary key.

### What is license2?

The ROS licence for players using Steam; it can be the same as `license`.

### Why is the discord identifier missing?

Discord must be running (desktop app) and linked when FiveM starts.

### How do I get the Steam identifier?

Set `steam_webApiKey` in server.cfg; players need Steam running.

### How do I get one identifier in Lua?

`GetPlayerIdentifierByType(source, 'license')`.

## Related

- https://fam-tools.com/guides/fivem-ban-system
- https://fam-tools.com/guides/fivem-ace-permissions
- https://fam-tools.com/guides/fivem-discord-whitelist-script
- https://fam-tools.com/guides/txadmin-admins-permissions
