Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Authentication Authorization?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/sivaprasadreddy-authentication-authorization)
---
name: authentication-authorization
description: Design identity, authentication, sessions, authorization, roles, permissions, and tenant access consistently across application types.
---
# Authentication and Authorization
## Purpose
Guide identity and access-control design independently of any identity provider, protocol, framework, or language.
## When to use
Use when adding login, logout, registration, account recovery, federation, service identities, roles, permissions, tenant isolation, or protected operations.
## Design principles
- Prefer established identity protocols and maintained identity providers over custom authentication mechanisms.
- Treat authentication (who is the caller?) and authorization (what may they do?) as separate decisions.
- Define the application’s identity model before implementing endpoints.
- Use stable internal subject identifiers; do not rely on mutable email addresses as primary identity keys.
- Model permissions around actions and resources. Roles may group permissions but should not become the only authorization mechanism when resource-level rules are needed.
- Enforce authorization at the trusted server-side boundary for every protected operation.
- Apply least privilege and deny by default.
- Make ownership, tenant membership, delegation, and administrative access explicit.
- Keep service-to-service identities separate from human identities.
- Design account lifecycle and recovery as security-critical workflows.
## Workflow
1. Identify user types, service actors, tenants, and administrative actors.
2. Define identity attributes and stable identifiers.
3. Select an established authentication approach appropriate to clients and deployment.
4. Define session/token lifecycle: issuance, expiry, renewal, revocation, storage, and logout semantics.
5. Define authorization rules for actions, resources, ownership, and tenant boundaries.
6. Specify registration, verification, recovery, lockout, and account deactivation behavior where applicable.
7. Define audit events for login, failures, privilege changes, and sensitive actions.
8. Test both permitted and forbidden access paths, including cross-user and cross-tenant access.
## Security expectations
- Never store plaintext passwords; use a purpose-built password hashing algorithm and appropriate parameters.
- Protect credentials and tokens in transit and at rest.
- Avoid long-lived bearer credentials unless there is a justified design and compensating protection.
- Validate token issuer, audience, signature, expiry, and relevant claims.
- Do not trust client-supplied roles, user IDs, tenant IDs, or permission claims without verification.
- Protect browser sessions with appropriate cookie flags and CSRF defenses.
- Rate-limit credential, recovery, and verification workflows.
- Avoid account enumeration in public-facing recovery and login responses where relevant.
- Revoke or invalidate sessions after credential changes and account compromise.
- Ensure administrative and support access is tightly controlled and auditable.
## Authorization test matrix
For each protected resource, test:
- Anonymous caller.
- Authenticated caller without permission.
- Authorized owner.
- Different authenticated user.
- User in a different tenant.
- Privileged administrator.
- Revoked, expired, or disabled identity.
## Expected output
Document identity types, authentication flow, session/token policy, permission model, tenant/ownership rules, lifecycle workflows, and audit requirements. Avoid adding roles or permission abstractions that the product does not need.