Access to user data can be handled in a few ways. It is dependent on settings in your AE Connect authentication flow configuration.
To return all of the current user's data, use the
auth_window = true
In cases where your
If the user session already exists, a user object is available as part of the
The user object will also be broadcast across any
onUser event handlers. See our AE JS Events Reference documentation for more information.
auth_window = false
In cases where
auth_window setting had been set to
true. However, when the
auth_window setting is set to
false, the user is redirected to another URL for authentication with a social network.
Once the user has been authenticated and is sent to the return URL, you can use the provided
accesstoken to access to their user data. The
accesstoken can be used to make an
auth call to the AE REST API and return required user data.
Secure Calls to the AE REST API
Note that all of your calls to the AE REST API should be made via server-side code.
We recommend that this code run on a local machine with its IP allowlisted from your AE dashboard.