Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[feature]: TOTP-Based Secure Action Token for Sensitive API Operations #1

Open
chornthorn opened this issue Nov 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request security

Comments

@chornthorn
Copy link
Owner

chornthorn commented Nov 14, 2024

Description

Enhance our existing Keycloak extension by adding a TOTP-based secure action token system. This new feature will provide an additional layer of security for sensitive API operations, particularly for payment processes, protecting against unauthorized access and potential security breaches.

Key Requirements

  • Integrate TOTP-based authentication for sensitive actions
  • Add functionality to generate short-lived, single-use tokens for specific sensitive actions post-TOTP verification
  • Implement new REST endpoints in our extension for TOTP verification and action token generation
  • Maintain compatibility with existing features

Implementation Steps

  • Implement TOTP-integrated token generation and storage mechanism
  • Add new REST endpoints for TOTP verification and action token issuance
  • Develop TOTP and token validation logic with security checks
  • Integrate new features with existing custom authenticators and required actions
  • Add configuration options for TOTP features in Keycloak admin console
  • Implement error handling for expired or invalid TOTP/tokens

Expected Outcome

An enhanced version of our Keycloak extension that includes a robust, TOTP-based security system for sensitive operations, seamlessly integrated with our existing functionality.

Demo

The following sequence diagram demonstrates how the new TOTP-based secure action token system will integrate with our existing Keycloak extension:

sequenceDiagram
    participant User
    participant MobileApp
    participant API
    participant Database
    participant PaymentProcessor

    User->>MobileApp: Initiates payment
    MobileApp->>User: Prompts for TOTP
    User->>MobileApp: Enters TOTP
    MobileApp->>API: Sends TOTP for verification
    API->>Database: Validates TOTP
    Database-->>API: TOTP valid
    API->>Database: Generates & stores action token
    API-->>MobileApp: Returns action token
    MobileApp->>API: Sends payment request with action token
    API->>Database: Verifies action token
    alt Token Valid
        Database-->>API: Token verified
        API->>Database: Marks token as used
        API->>PaymentProcessor: Processes payment
        PaymentProcessor-->>API: Payment result
        API-->>MobileApp: Payment success
        MobileApp->>User: Displays success message
    else Token Invalid or Expired
        Database-->>API: Token invalid
        API-->>MobileApp: Payment rejected
        MobileApp->>User: Displays error, prompts for re-authentication
    end
Loading
@chornthorn chornthorn added the enhancement New feature or request label Nov 14, 2024
@chornthorn chornthorn self-assigned this Nov 14, 2024
@chornthorn chornthorn changed the title [feature]: Implement TOTP-Based Secure Action Token System for Sensitive API Operations [feature]: TOTP-Based Secure Action Token System for Sensitive API Operations Nov 14, 2024
@chornthorn chornthorn changed the title [feature]: TOTP-Based Secure Action Token System for Sensitive API Operations [feature]: TOTP-Based Secure Action Token for Sensitive API Operations Nov 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request security
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant