StackPractices

authentication

Practical resources about authentication for software engineers.

23 results

Securing Access to Your Systems

Authentication and authorization are the foundation of application security. From password hashing and JWT tokens to OAuth2 flows and multi-factor authentication, getting identity right protects both your users and your data.

These resources cover proven patterns for session management, API key handling, SSO with SAML, and role-based access control. Each guide explains when to use a given approach, common pitfalls to avoid, and complete implementation examples.

intermediate

Secure API Key Authentication for Services and Clients

How to generate, distribute, validate, and rotate API keys for machine-to-machine authentication...

beginner

Hash Passwords with Argon2

How to hash and verify passwords securely with Argon2id, the winner of the Password Hashing...

advanced

Implement ABAC

How to implement attribute-based access control with policy engines, live context evaluation, and...

intermediate

Implement RBAC

How to implement role-based access control with hierarchical roles, permission grants, and...

advanced

Implement SSO with SAML

How to implement SAML 2.0 single sign-on as a Service Provider with XML signature verification, IdP...

intermediate

JWT Authentication

How to generate, validate, and refresh JSON Web Tokens for stateless API authentication.

intermediate

Implement Passwordless Login with Magic Links

How to build secure passwordless authentication using time-limited magic links sent via email, with...

intermediate

Node.js JWT Authentication: Verify and Refresh Tokens

Implement JWT authentication in Node.js with access and refresh tokens

intermediate

Node.js OAuth2 GitHub Login with Express

Implement GitHub OAuth2 login flow in Node.js with Express and Passport

intermediate

OAuth 2.0 Login

How to implement OAuth 2.0 authentication with Google, GitHub, and other providers.

intermediate

How to Hash Passwords Securely (Python, JavaScript, Java)

Learn how to hash and verify passwords with bcrypt, Argon2, and PBKDF2. Practical examples in...

intermediate

Implement Secure Session Management

How to create, validate, and expire user sessions securely across web applications using cookies,...

intermediate

Two-Factor Authentication (2FA / TOTP)

How to implement time-based one-time password (TOTP) two-factor authentication for secure user...

intermediate

Store User Sessions in Memcached with Python

Use Memcached as a distributed session store in Python web applications with pymemcache, TTL...

python caching sessions distributed-cache
advanced

Field-Level Auth with Custom GraphQL Directives

Add field-level authorization to GraphQL with custom schema directives. Check roles, permissions,...

intermediate

Implement OAuth 2.0 PKCE for Single-Page Applications

How to implement the OAuth 2.0 PKCE flow in single-page applications to securely authenticate users...

intermediate

Secure JWT Refresh Token Rotation with Python

Implement secure JWT access and refresh token rotation in Python with blacklist, reuse detection,...

advanced

Secure API Gateway with Custom Lambda Authorizers

Implement custom Lambda authorizers for API Gateway with JWT validation, IAM policy generation, and...

advanced

Federated Identity Pattern

Delegate authentication to external identity providers. A pattern for integrating OAuth2, OIDC,...

advanced

Voucher Pattern

Validate claims and delegate access using signed vouchers without exposing sensitive data. A...

No results found.