A Context Aware Framework for Secure Fintech APIs: Leveraging Java Spring Boot and OAuth 2.0 with Dynamic Token Adaptation
Main Article Content
Abstract
Fintech applications are generally designed to maintain ultra low latency sub 25 ms p99 and high performance and enterprise grade security requirements to secure millions of high value transactions. This paper presents Dynamic Contextual OAuth Token Adaptation (DCOTA), an innovative Java SpringBoot framework built to enhance standard Oauth 2 flows in real-time with context-aware token policies. We calculate a per request risk score considering device fingerprinting, geolocation, transaction amount and network jitter and dynamically augmenting JSON Web Token (JWT) scope, time to live (TTL), and rate limits on the fly. We designed a three-tier architecture consists of a mutual TLS terminating API Gateway, a DCOTA filtering layer that validates with JWK backed JWTs, and Spring Boot resource servers that use clustered Redis as storage for atomic revocation. We calculated time complexity of DCOTA to be ????(1) and revocation in O(logN) (Eq. 1–2). A comprehensive test suite includes functional testing using JUnit 5 & Mockito, load testing using Apache JMeter, and penetration using OWASP ZAP & Burp Suite. Under WAN emulation we achieved 50 ms RTT at 0.1 % packet loss. DCOTA incurs only a 2 ms median latency overhead and 84 % less unauthorized attempts while keeping ≥ 230 TPS. The outcomes affirm DCOTA’s variant and contemporary high performance, secure fintech API deployments.