Plugin: Auto Login Placeholder
Email template placeholder
Section titled “Email template placeholder”This plugin adds the %autologinlink% placeholder to aMember email
templates. When an email is sent, the placeholder is replaced with a unique
link such as:
https://example.com/amember/l/A43803CY4569Opening the link logs the recipient in to aMember automatically. The link remains valid for the lifetime configured in the plugin and is invalidated when the user changes their password.
Generate an auto-login link with the REST API
Section titled “Generate an auto-login link with the REST API”The plugin adds the GET /api/autologinlink endpoint. Before using it:
- Enable the REST API module.
- Go to aMember CP > Configuration > Remote API Permissions and create or edit an API key.
- Grant the API key
indexpermission for theautologinlinkcontroller.
See REST API authorization and API key setup for general REST API configuration.
Identify the user with one of these query parameters:
| Parameter | Description |
|---|---|
user_id | aMember user ID |
login | aMember username |
email | User's email address |
Send only one user identifier per request. For example, the following request
finds a user by email address and supplies the API key in the X-API-Key
header:
curl --get 'https://example.com/amember/api/autologinlink' \ --header 'X-API-Key: APIKEY' \ --data-urlencode 'email=member@example.com'A successful request returns the generated link:
{ "ok": true, "autologinlink": "https://example.com/amember/l/A43803CY4569"}If no user matches the supplied identifier, the response is:
{ "ok": false, "msg": "Unable to find user"}You can supply the API key in the _key query parameter instead, but using
the header prevents the key from appearing in URLs and access logs. Use HTTPS
and treat both the API key and generated links as secrets. Anyone with a valid
auto-login link can sign in as that user until the link expires.
Copyright © 2002–2026 www.amember.com. All Rights Reserved.