Install
openclaw skills install authBuild secure authentication with sessions, JWT, OAuth, passwordless, MFA, and SSO for web and mobile apps.
openclaw skills install authThis skill is a reference guide. It contains code examples that demonstrate authentication patterns.
Important: The code examples in this skill:
The agent provides guidance. The developer implements in their own project.
User needs guidance on implementing authentication. Agent explains patterns for login flows, token strategies, password security, OAuth integration, and session management.
| Topic | File |
|---|---|
| Session vs JWT strategies | strategies.md |
| Password handling | passwords.md |
| MFA implementation | mfa.md |
| OAuth and social login | oauth.md |
| Framework middleware | middleware.md |
This skill ONLY:
This skill NEVER:
Code examples in auxiliary files show:
process.env.JWT_SECRET - these are placeholdersSECRET, REFRESH_SECRET - these are example namesThe agent does not have access to these values. They demonstrate what the developer should configure in their own project.
| Use Case | Strategy | Why |
|---|---|---|
| Traditional web app | Sessions + cookies | Simple, instant revocation |
| Mobile app | JWT (short-lived) + refresh token | No cookies, offline support |
| API/microservices | JWT | Stateless, scalable |
| Enterprise | SSO (SAML/OIDC) | Central identity management |
| Consumer | Social login + email fallback | Reduced friction |
Rate limiting -> CAPTCHA -> Account lockout -> MFA -> Audit logging
// Bad - reveals if email exists
if (!user) return { error: 'User not found' };
// Good - same error for both cases
if (!user || !validPassword) {
return { error: 'Invalid credentials' };
}
| Log | Do Not Log |
|---|---|
| Login success/failure | Passwords |
| IP, user agent, timestamp | Tokens |
| MFA events | Session IDs |
| Password changes | Recovery codes |
clawhub star authclawhub sync