Authentication authorization

From cosmicstack-labs/mercury-agent-skills · View interactive version

Authentication authorization is an AI agent skill from the GitHub repository cosmicstack-labs/mercury-agent-skills. JWT, OAuth2, SAML, session management, RBAC, ABAC, and MFA implementation

How to use this skill

Skill file

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

Authorization Models

RBAC (Role-Based)

{
  "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

Enforcement

Session Management

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.