Skip to main content
Verify External User
Accepts a JWT signed by your own auth system and returns Sublay tokens. If the user does not exist in the project, they are created. If they do exist, their profile is updated with any changed fields from the JWT payload. A user who hasn’t signed in this way before is matched by email to an existing user. Sublay trusts your auth system to have confirmed that email, so if the matched user never verified it, its password is removed, every provider linked to it is unlinked, and all of its sessions are signed out (an access token already issued stops working within 30 minutes and can’t be used to add a password, a provider or a push device): whoever set that account up may not own the address. The JWT must be signed with the RSA private key corresponding to the public key configured in your Sublay project settings.

Body Parameters

string
required
A JWT signed with your project’s RSA private key (RS256 algorithm). The payload must include sub (external user ID) and iss (your Sublay project ID). The userData claim may contain optional profile fields.

JWT Payload Structure

The userJwt must contain:

userData fields

Response

boolean
true on success.
string
Short-lived JWT access token. Expires in 30 minutes.
string
Long-lived JWT refresh token. Expires in 30 days.
object
The verified or created user’s profile.

Error Responses

The project does not have a public key configured.
The JWT signature is invalid or the token is expired.
The iss claim in the JWT does not match the request project ID.

See Also