Enable front-end authentication without creating WordPress user accounts. Requires the official Auth0 Login plugin.
Handles the OAuth flow, token management, and WordPress admin authentication. Creates WordPress user accounts for authenticated users.
Extends the official plugin to allow front-end-only authentication without creating WordPress users. Perfect for member-only content, gated resources, or authentication-based functionality.
Plugins → Add Newwp-content/plugins/Important: Auth0 for All will not function without the official Auth0 Login plugin installed and configured.
Access settings at Settings → Auth0 for All
When enabled, users who authenticate will NOT have WordPress user accounts created. They'll only exist as Auth0 sessions on the front-end.
Create custom login/logout pages for a seamless front-end experience:
Use in your theme or plugin code:
<?php
if ( function_exists( 'auth0_for_all_is_user_authenticated' ) ) {
if ( auth0_for_all_is_user_authenticated() ) {
// User is authenticated via Auth0
echo 'Welcome back!';
} else {
// User is not authenticated
echo 'Please log in';
}
}Access Auth0 user data:
<?php
$user_info = auth0_for_all_get_user_info();
if ( $user_info ) {
echo 'Email: ' . $user_info['email'];
echo 'Name: ' . $user_info['name'];
echo 'Auth0 ID: ' . $user_info['sub'];
}Generate authentication links:
<?php
// Login link
echo '<a href="' . auth0_for_all_login_url() . '">Log In</a>';
// Logout link
echo '<a href="' . auth0_for_all_logout_url() . '">Log Out</a>';Restrict access to authenticated users only:
<?php
if ( ! auth0_for_all_is_user_authenticated() ) {
// Redirect to login
wp_redirect( auth0_for_all_login_url() );
exit;
}
// Protected content here
?>auth0_for_all_user_loginFires after a user successfully authenticates (but before WordPress user creation).
add_action( 'auth0_for_all_user_login', function( $user_info ) {
// Do something when user logs in
error_log( 'User logged in: ' . $user_info['email'] );
});auth0_for_all_user_logoutFires when a user logs out.
add_action( 'auth0_for_all_user_logout', function() {
// Clean up custom data
});auth0_for_all_login_redirectModify where users are redirected after login.
add_filter( 'auth0_for_all_login_redirect', function( $url, $user_info ) {
// Redirect based on user role or metadata
if ( isset( $user_info['user_metadata']['vip'] ) ) {
return '/vip-dashboard';
}
return $url;
}, 10, 2 );auth0_for_all_user_dataFilter Auth0 user data before it's used.
add_filter( 'auth0_for_all_user_data', function( $user_info ) {
// Add custom data or modify existing
$user_info['custom_field'] = 'value';
return $user_info;
});Found a bug or have questions? Open an issue on GitHub or check the official Auth0 documentation.