For Developers

You can easily access the data of the current logged in user by calling the following methods:

$session = (new Bitmotion\Auth0\Factory\SessionFactory())->getSessionStoreForApplication();
$userInfo = $session->getUserInfo();

User metadata is also stored as plain JSON in the TYPO3 fe_user field auth0_metadata. Beside of that, the last used application is stored in the auth0_last_application property of the fe_user.

If you want to enrich the user metadata or remove some information, you can do it this way:

// Get the user Id
$sessionStore = (new SessionFactory())->getSessionStoreForApplication();
$user = $session->getUserInfo();
$userId = $user['sub'];

// Prepare data
$data = new \stdClass();
$data->favourite_color = 'blue';

// Update Auth0 user
$managementApi = GeneralUtility::makeInstance(ManagementApi::class, $application);
$managementApi->users->update($userId, $data);

Hooks

Note

Please note that this hook is considered deprecated and will be removed with version 4.0.0. Please use the PSR-14 event instead (when possible).

The hook is available in the $GLOBALS['TYPO3_CONF_VARS'] array:

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['auth0']['redirect_pre_processing']

The called method receives the redirect URL (string) as argument. For more information you can read the following event section.

Events

Note

Events are available in TYPO3 v10 only.

You can manipulate the actual redirect URI by listening to the RedirectPreProcessingEvent. This event is called when a user successfully logged in or logged off to / from your TYPO3 instance. Find more about event listening in the official TYPO3 documentation.