Authentication¶
Logging in as a Frontend-User with the TYPO3 RestApi¶
The EXT:nnrestapi
ships with an endpoint for logging in as a frontend-user (fe_user
) and for checking the login-status
of the current user.
nnrestapi offers three different options for authenticating:
- Authorization via JSON Web Tokens (JWT)
- Cookie-based Authorization. This uses the same
fe_typo_user
cookie that is set for “normal” Frontend-Users. - Basic Authorization via HTTP
Links and recipes¶
To learn how to authenticate, dive in to one of the following recipes:
Link to documentation | Content |
---|---|
Configuring access right | Make sure, not anybody can access certain endpoints. Restrict access to certain frontend-users or -groups. |
Authentication via HTTP Basic Auth | How to set username and password for individual users and as a global api-key for multiple users. The authentication will work using the HTTP Basic Authentication. |
Frontend example, plain JS | Example fe_user-auth using nothing but pure JavaScript (“VanillaJS”). Requires a modern browser that support ES6+ (anything but Internet Explorer 11 and below) |
Frontend example, legacy JS | Example fe_user-auth using nothing but pure JavaScript (“VanillaJS”).
Same like above, but for older browsers that can’t use fetch()
(e.g. Internet Explorer 11 and below) |
Frontend example with AXIOS | Pure JavaScript solution, but with a little help from the great JS library “axios” that makes life a little easier. |
Frontend example with jQuery | If you still like jQuery, although the world is moving somewhere else, here is an example for the authentication using jQuery. |