Authentication overview
LoginRadius offers a Customer Identity and Access Management (CIAM) platform designed to manage and secure customer identities. Its authentication services facilitate various login experiences, from traditional username/password to modern passwordless and multi-factor authentication (MFA). The platform integrates with applications via its API and SDKs, providing tools for developers to implement secure and scalable authentication flows. It supports industry-standard protocols such as OAuth 2.0 and OpenID Connect, allowing for flexible integration across different client applications and identity providers.
The core of LoginRadius's authentication system focuses on providing a unified identity experience for users while ensuring data security and regulatory compliance. This involves managing user profiles, consent, and session lifecycles. Developers can configure authentication policies, such as password complexity requirements and session durations, through the LoginRadius Admin Console. The system also supports various social login providers, streamlining the user registration and login process by leveraging existing social identities.
Supported authentication methods
LoginRadius supports a range of authentication methods to cater to different user preferences and security requirements. These methods can be combined, for instance, by enabling MFA on top of a password-based login. The choice of method often depends on the application's security needs, user experience goals, and compliance obligations.
| Method | When to Use | Security Level |
|---|---|---|
| Password-based Login | Standard web and mobile applications requiring traditional user accounts. | Moderate (depends on password strength and hashing) |
| Social Login | Enhancing user experience and conversion by allowing login via platforms like Google, Facebook, or Apple. | Moderate (relies on external IdP security) |
| Passwordless Login | Improving user experience and reducing password fatigue via email magic links, SMS passcodes, or QR codes. | High (eliminates password-related vulnerabilities) |
| Multi-Factor Authentication (MFA) | Adding an extra layer of security to any login method, typically via TOTP, SMS, or email verification. | Very High (requires multiple proof factors) |
| Single Sign-On (SSO) | Allowing users to access multiple applications with a single set of credentials within an organization or suite of services. | High (centralized identity management) |
| Federated Authentication | Integrating with external identity providers (IdPs) using protocols like SAML or OpenID Connect for enterprise scenarios. | High (leverages trusted IdPs) |
For enhanced security, LoginRadius encourages the implementation of MFA, which adds a second factor of authentication beyond the traditional username and password. This typically involves something the user has (like a phone with a TOTP app) or something the user is (like a fingerprint), in addition to something they know (the password). The FIDO Alliance promotes strong authentication standards, which align with the security goals of MFA. Passwordless authentication, on the other hand, aims to simplify the login process while often increasing security by removing the need for users to create and remember complex passwords; instead, it relies on one-time passcodes or biometric verification.
Getting your credentials
To begin authenticating with LoginRadius, you need to obtain your API credentials from the LoginRadius Admin Console. These credentials typically include an API Key and an API Secret, which are essential for making authenticated requests to the LoginRadius API. The process generally involves:
- Signing up for a LoginRadius account: If you don't already have one, you can sign up for a Developer Plan, which offers a free tier for up to 25,000 users.
- Accessing the Admin Console: Once registered, log in to your LoginRadius Admin Console.
- Navigating to API Credentials: Within the console, locate the section for 'API Credentials' or 'API Settings'. This area typically displays your unique API Key and API Secret.
- Configuring Application Settings: You may also need to configure your application's redirect URLs and other security settings within the Admin Console to ensure proper callback handling for OAuth 2.0 and OpenID Connect flows. The LoginRadius documentation provides detailed setup guides for various application types.
It is crucial to keep your API Secret confidential and never expose it in client-side code or public repositories. For client-side applications (like web or mobile apps), you typically use the API Key, and the API Secret is used for server-side operations or when making direct API calls from a secure backend. LoginRadius SDKs abstract some of these complexities, allowing developers to integrate authentication features with less direct handling of raw API calls.
Authenticated request example
Authenticated requests to LoginRadius APIs typically involve including the API Key as a query parameter or in the request header, and for sensitive operations, a server-side API Secret might be required for HMAC-based signatures or direct API calls. The following example demonstrates a common scenario: fetching a user's profile data after they have successfully authenticated and received an access token. This example uses a hypothetical client-side JavaScript approach, where the access token is obtained after a successful login flow (e.g., via social login or passwordless). For full API details, refer to the LoginRadius API reference documentation.
const API_KEY = 'YOUR_LOGINRADIUS_API_KEY';
const ACCESS_TOKEN = 'USER_ACCESS_TOKEN_AFTER_LOGIN'; // Obtained after successful authentication
fetch(`https://api.loginradius.com/identity/v2/auth/account?access_token=${ACCESS_TOKEN}&apikey=${API_KEY}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
console.log('User Profile Data:', data);
})
.catch(error => {
console.error('Error fetching user profile:', error);
});
In this example, YOUR_LOGINRADIUS_API_KEY should be replaced with your actual API Key obtained from the Admin Console. The USER_ACCESS_TOKEN_AFTER_LOGIN is a temporary token granted to a user after a successful login, which is then used to authorize subsequent requests on behalf of that user. This token has a limited lifespan and should be securely stored (e.g., in HTTP-only cookies or local storage for client-side applications, with appropriate security measures). Server-side applications would typically use the API Secret to sign requests or directly access management APIs, ensuring a higher level of security for sensitive operations.
Security best practices
Implementing strong authentication requires adherence to security best practices to protect user data and prevent unauthorized access. LoginRadius provides features and guidance to help developers achieve this.
- Protect API Keys and Secrets: Never hardcode API Secrets in client-side code. Store them securely on your server or in environment variables. For client-side applications, use the API Key, but ensure sensitive operations are handled server-side where the API Secret can be used securely.
- Implement Multi-Factor Authentication (MFA): Enable MFA for all user accounts, especially for administrators. This adds an essential layer of security, significantly reducing the risk of account compromise. The OAuth 2.0 framework, often used with LoginRadius, supports various security extensions that can integrate MFA.
- Strong Password Policies: If using password-based authentication, enforce strong password policies (length, complexity, uniqueness) and regularly encourage users to update their passwords. LoginRadius handles password hashing and storage securely, but client-side validation and enforcement are still important.
- Secure Token Storage: Access tokens and refresh tokens should be stored securely. For web applications, HTTP-only cookies are generally recommended for refresh tokens to mitigate XSS attacks. Access tokens can be stored in memory or local storage for short durations, with careful consideration of the risks.
- Input Validation and Sanitization: Always validate and sanitize all user inputs to prevent injection attacks (e.g., SQL injection, XSS).
- Rate Limiting: Implement rate limiting on authentication endpoints (login, registration, password reset) to prevent brute-force attacks and denial-of-service attempts. LoginRadius's platform includes built-in abuse prevention mechanisms, but additional application-level rate limiting may be beneficial.
- Regular Security Audits: Conduct regular security audits and penetration testing of your applications to identify and address vulnerabilities.
- Keep Dependencies Updated: Ensure all libraries, frameworks, and SDKs are kept up-to-date to patch known security vulnerabilities.
- Educate Users: Provide clear guidance to users on creating strong passwords, recognizing phishing attempts, and the importance of MFA.
- Centralized Logging and Monitoring: Implement comprehensive logging and monitoring of authentication events to detect and respond to suspicious activities promptly.