Authentication Authorization

JWT, OAuth2, SAML, session management, RBAC, ABAC, and MFA implementation

492 stars 68 forksSoftware Development

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add cosmicstack-labs/mercury-agent-skills --skill authentication-authorization
Manual install
git clone --depth 1 https://github.com/cosmicstack-labs/mercury-agent-skills.git /tmp/mercury-agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/mercury-agent-skills/categories/backend/authentication-authorization ~/.claude/skills/authentication-authorization

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Authentication & Authorization

Implement secure auth in your applications.

## Authentication Methods

| Method | Use Case | Security Level |
|--------|----------|---------------|
| Session/Cookie | Server-rendered apps | High (HTTP-only, secure flags) |
| JWT | APIs, SPAs | Medium (stateless, revocable with blacklist) |
| OAuth2 | Third-party login | High (delegate to providers) |
| SAML | Enterprise SSO | High (enterprise identity) |
| WebAuthn | Passwordless | Very high (biometric, hardware keys) |

### JWT Best Practices
- Short expiry (15 min access, 7 day refresh)
- Store refresh tokens in HTTP-only cookies (not localStorage)
- Use RS256 (asymmetric) not HS256 in microservices
- Include minimal claims (sub, exp, iat, scope)
- Always validate signature + expiry + audience

## Authorization Models

### RBAC (Role-Based)
```json
{
  "roles": ["admin", "editor", "viewer"],
  "permissions": {
    "admin": ["read:*", "write:*", "delete:*"],
    "editor": ["read:*", "write:*"],
    "viewer": ["read:*"]
  }
}
```

### ABAC (Attribute-Based)
Policy engine evaluates: user attributes + resource attributes + environment
*"Allow access if user.department == resource.department AND user.clearance >= resource.classification"*

## MFA Implementation
- TOTP (Google Authenticator) — standard
- SMS — least secure, avoid if possible
- Push notification — good UX
- Hardware keys (WebAuthn) — most secure

### Enforcement
- Require MFA for admin actions
- Require MFA on new device login
Read the full skill on GitHub

Details

Skill name
authentication-authorization
Path
categories/backend/authentication-authorization/SKILL.md
License
MIT
Repo updated
25 August 2026

FAQ

What does the Authentication Authorization skill do?

JWT, OAuth2, SAML, session management, RBAC, ABAC, and MFA implementation

How do I install the Authentication Authorization skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add cosmicstack-labs/mercury-agent-skills --skill authentication-authorization. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Authentication Authorization popular?

It lives in cosmicstack-labs/mercury-agent-skills, which has 492 GitHub stars and 68 forks.

Related skills

Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.