Docs/Security/Authentication

Authentication

SecureCodingHub supports multiple authentication methods. All sessions use JWT tokens with short expiration times for security.

Authentication Methods

Choose the authentication method that best fits your organization:

Magic Code (Email OTP)

Passwordless login via 6-digit code sent to email. Default method for all users. Codes expire after 10 minutes. No password to manage or remember.

OIDC (OpenID Connect)

Enterprise SSO via Azure AD, Okta, or compatible providers. Authorization code flow with PKCE. Recommended for organizations.

SAML 2.0

Federation-based SSO for enterprise environments. SP-initiated login flow.

Magic Code Flow

The default passwordless authentication flow works as follows:

1

User enters their email address

2

Server sends a 6-digit OTP to the email

3

User enters the code

4

Server verifies the code and issues a JWT

5

JWT is stored in the browser for session management

SSO Flow

When SSO is configured for your organization, the authentication flow changes:

1

User enters email — system detects SSO is enabled for their domain

2

Browser redirects to identity provider

3

User authenticates with corporate credentials

4

IdP sends authorization code (OIDC) or SAML assertion back

5

Server validates response and issues a JWT

6

User is logged in

JWT Tokens

All authenticated sessions are managed using JSON Web Tokens:

PropertyValue
AlgorithmHS256
ContainsUser ID, Organization ID, Role
TransmissionAuthorization: Bearer header
StorageHttpOnly cookie or localStorage

Session Security

  • Tokens are validated on every API request
  • Invalid or expired tokens are rejected
  • SSO sessions respect IdP session policies
  • Magic codes are single-use and time-limited