This document holds sample authentication flows for various use cases for XIVAuth.
In user-based authentication, the Relying Party wishes to authenticate against a particular user, rather than a character. This authentication model is beneficial when a service wishes to track a particular player rather than a character (e.g. for moderation or community purposes). Examples of applications that would use user-based authentication are forums, game mod platforms, license management systems, or general user-level activity.
user
scope. The user is served the redirect and is taken to XIVAuth.authorization_code
and redirect the user back to the Relying Party’s site, in standard OAuth fashion.authorization_code
for an access_token
which can be used in future requests./users
in order to retrieve user information.
If the Relying Party has requested additional scopes, they will be able to make any required API calls using their access_token
until such time as it expires. This may be used if a Relying Party wishes to request both user and character information.
For services that do not require user management or do not care about the underlying user, Character-Based Authentication may be used instead. In this mode, XIVAuth will only allow an Access Token to retrieve one (or more) characters depending on the user’s consent choices. Examples of applications that would use character-based authentication are character leaderboards, marketplace applications, or other services that do not wish to track or work with users.
character
scope. The user is served the redirect and taken to XIVAuth.
character:all
scope may be requested instead.character:all
scope was selected, the user will be able to select one or more characters.authorization_code
and redirect the user back to the Relying Party’s site, in standard OAuth fashion.
authorization_code
is permitted to use.authorization_code
for an access_token
which can be used in future requests.
authorization_code
over to the access_token
./characters
in order to retrieve character information.
character
scope was passed, there will always be one (and only one) entry in the returned API call. However, if the character:all
scope was requested, there may be one or more entries in the returned call. In the latter case, it is the responsibility of the Relying Party to handle character selection.Developers wishing to use character authentication should rely on the persistent_key
field rather than lodestone_id
. The persistent_key
field is derived from the user’s ID and Lodestone ID, and is guaranteed to not change if the user deletes and recreates the character, but will change if the character is moved to a different user’s account. Developers should take care of gracefully handling this case to prevent data leakage between users if a character is transferred.
If additional scopes were requested, the Relying Party may use the Access Token for those queries as well. Unless the user
scope was requested in addition to the character
scope, the Relying Party will not be able to request user information.