Authentication
Manage users in R2R with built-in authentication
Occasionally this SDK documentation falls out of date, cross-check with the automatcially generated API Reference documentation for the latest parameters.
User Authentication and Management
R2R provides a comprehensive set of user authentication and management features, allowing you to implement secure and feature-rich authentication systems in your applications.
User Registration
To register a new user:
Email Verification
If email verification is enabled, verify a user’s email:
User Login
To log in and obtain access tokens:
Get Current User Info
Retrieve information about the currently authenticated user:
Refresh Access Token
Refresh an expired access token:
Change Password
Change the user’s password:
Request Password Reset
Request a password reset for a user:
Confirm Password Reset
Confirm a password reset using the reset token:
Update User Profile
Update the user’s profile information:
Delete User Account
Delete the user’s account:
User Logout
Log out and invalidate the current access token:
Superuser Capabilities
Superusers have additional privileges, including access to system-wide operations and sensitive information. To use superuser capabilities, authenticate as a superuser or the default admin:
Superuser actions should be performed with caution and only by authorized personnel. Ensure proper security measures are in place when using superuser capabilities.
Security Considerations
When implementing user authentication, consider the following best practices:
- Always use HTTPS in production to encrypt data in transit.
- Implement rate limiting to protect against brute-force attacks.
- Use secure password hashing (R2R uses bcrypt by default).
- Consider implementing multi-factor authentication (MFA) for enhanced security.
- Conduct regular security audits of your authentication system.
For more advanced use cases or custom implementations, refer to the R2R documentation or reach out to the community for support.