Auth

Generate a login token

Changed on

Generate a login token. If the visitor is already logged into a XenForo account, they will not be logged into the specified account. Only available to super user keys.

post/auth/login-token

Request

Request body application/x-www-form-urlencoded

user_idinteger required
limit_ipstring

If provided, locks the token to the specified IP for additional security

return_urlstring

If provided, after logging the user will be returned to this URL. Otherwise they'll go to the XenForo index.

forceboolean

If provided, the login URL will forcibly replace the currently logged in user if a user is already logged in and different to the currently logged in user. Defaults to false.

rememberboolean

Controls whether the a "remember me" cookie will be set when the user logs in. Defaults to true.

Response

OK

login_tokenstring
login_urlstring

Direct user to this URL to trigger a login

expiry_dateinteger

Unix timestamp of when the token expires. An error will be displayed if the token is expired or invalid

Changes

    • breaking

      request body became required

    • breaking

      removed the media type application/json from the request body

    • info

      api operation id post_auth_login_token removed and replaced with postAuthLoginToken

    • info

      the endpoint scheme security XF-Api-Key was added to the API

    • info

      the endpoint scheme security XF-OAuth2 was added to the API

    • info

      added the new optional header request parameter XF-Api-User to all path's operations

    • info

      added the new optional query request parameter api_bypass_permissions to all path's operations

    • warning

      the optional response header XF-Latest-Api-Version removed for the status 200

    • warning

      the optional response header XF-Request-User removed for the status 200

    • warning

      the optional response header XF-Request-User-Extras removed for the status 200

    • warning

      the optional response header XF-Used-Api-Version removed for the status 200

    • info

      api operation id postAuthLoginToken removed and replaced with post_auth_login_token

    • info

      the endpoint scheme security XF-Api-Key was removed from the API

    • info

      the endpoint scheme security XF-OAuth2 was removed from the API

    • info

      request body became optional

    • info

      added the media type application/json to the request body