auth-implementation
Skill9 starsChanged 4 months agoMITView on GitHub
Authentication, SSO, OAuth, OIDC, login, redirect, token implementation patterns. Use when implementing auth flows, login pages, token refresh, SSO integration, or redirect handling.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- guptadeepak/auth-implementation-skilltheir own version, first seen Nov 8, 2026
- reddygopalkrishna/developer-agent-skillstheir own version, first seen Nov 8, 2026
- int2t05/engineering-skillstheir own version, first seen Oct 15, 2026
- sattva2020/skillstheir own version, first seen Mar 9, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- reddygopalkrishna/developer-agent-skills★ 8same name
- guptadeepak/auth-implementation-skill★ 4same name
- int2t05/engineering-skills★ 3same name
- sattva2020/skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- .claude/CLAUDE.mdCLAUDE.md
- incident-responseSkill
- kiro-railsSkill
- review-guideSkill
- spec-archiveSkill
- spec-implementSkill
- spec-proposeSkill
- spec-verifySkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. 0 are common, 15 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
When implementing any authentication flow, ALL of the following paths must be handled.
- Distinctive: line 19
Never fire API requests before confirming token is available
- Distinctive: line 22
No token in storage → show login UI or redirect to identity provider
- Distinctive: line 23
Don't auto-redirect without checking if a session exists first
- Distinctive: line 28
Never redirect from login page back to login page
- Very specific: line 31
Cognito: does NOT support prompt=none for silent auth
- Distinctive: line 34
Always check provider documentation for supported parameters
- Distinctive: line 37
If identity provider is unreachable → show error, don't crash the app
- Distinctive: line 38
If OIDC discovery endpoint fails → fall back to manual config or show maintenance page
- Distinctive: line 39
Never make the entire app dependent on auth provider availability for rendering
- Very specific: line 43
redirect_urimust be dynamic: - use window.location.origin + callback path. - Very specific: line 44
State parameter: - always include a random state param to prevent CSRF.
- Distinctive: line 48
Multi-tab sync: - if user logs out in one tab, other tabs should detect it (via storage event or BroadcastChannel).
- Distinctive: line 52
Test with expired tokens (mock token expiry)
- Distinctive: line 53
Test with identity provider down (mock network failure)
- Distinctive: line 54
Test redirect loop scenario (verify max 2 redirects)
- Distinctive: line 55
Test multi-tab logout propagation
- Distinctive: line 56
Test with clock skew (token appears expired due to time difference)
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Auth Implementation Checklist
When implementing any authentication flow, ALL of the following paths must be handled. Do not implement only the happy path.
Mandatory Paths
1. Happy Path
- User has valid session → proceed normally
- User authenticates successfully → redirect to intended destination
2. Expired Token
- Access token expired → attempt silent refresh with refresh token
- Refresh token expired → redirect to login (not infinite loop)
- Never fire API requests before confirming token is available
3. Missing Session
- No token in storage → show login UI or redirect to identity provider
- Don't auto-redirect without checking if a session exists first
4. Redirect Loop Prevention
- Max 2 redirects then show an error page with clear message
- Store redirect count in sessionStorage, reset on successful auth
- Never redirect from login page back to login page
5. Provider-Specific Quirks
- Cognito: does NOT support
prompt=nonefor silent auth - Keycloak: supports
prompt=nonebut returnslogin_requirederror if no session - Auth0: supports silent auth via
/authorizewithprompt=none - Always check provider documentation for supported parameters
6. Graceful Degradation
- If identity provider is unreachable → show error, don't crash the app
- If OIDC discovery endpoint fails → fall back to manual config or show maintenance page
- Never make the entire app dependent on auth provider availability for rendering
Implementation Rules
redirect_urimust be dynamic - usewindow.location.origin+ callback path. Never hardcodelocalhost.- State parameter - always include a random
stateparam to prevent CSRF. Verify it on callback. - Token storage - access tokens in memory (short-lived), refresh tokens in httpOnly cookies or secure storage. Never localStorage for refresh tokens.
- Logout must clear ALL state - tokens, cached user info, query cache, any auth-dependent state.
- 401 handling - on 401 response, attempt ONE silent refresh. If that fails, redirect to login. Don't retry indefinitely.
- Multi-tab sync - if user logs out in one tab, other tabs should detect it (via storage event or BroadcastChannel).
Testing Requirements
- Test with expired tokens (mock token expiry)
- Test with identity provider down (mock network failure)
- Test redirect loop scenario (verify max 2 redirects)
- Test multi-tab logout propagation
- Test with clock skew (token appears expired due to time difference)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

