• About Us
    • Who We Are
    • Our Work
    • Our Clients
    • Our Partners
    • Our Blog
    • News & Events
    • Insights
  • Solutions

    Analytics & Data Management

    Big DataBusiness AnalyticsData IntegrationData Warehousing

    Digital Business Automation

    Advanced Case ManagementBusiness Rules ManagementBusiness Process ManagementRobotic Process Automation

    Connectivity & System Integration

    Agile IntegrationAPI ManagementEnterprise Service Bus

    Enterprise Content Management

    Content Capturing & ImagingEnterprise Content Management

    Enterprise Portal & Mobility

    Digital Customer ExperienceDigital Workplace

  • Industry Solutions

    • Banking >
    • Government >

    Digital Banking Transformation

    Business Process Management

    Business Rules Management

    Checks Collection & Clearing

    Counter Fraud Management

    Customer Due Diligence

    Customer Onboarding

    Daily Vouchers Management

    Debt Collections & Recovery

    Instant Payment Network Gateway

    Enterprise Content Management

    Enterprise Service Bus

    Smart Analytics

    Trade Finance Automation

    Digital Government Transformation

    Business Analytics

    Business Process Management

    Correspondence Management

    Documents & Records Management

    Enterprise Service Bus

    Pensions & Social Programs

    Social Collaboration Portal

    Strategy Management

    Utility Billing

  • Services
    • Cloud Apps & Microservices
    • IT Consultancy
    • Application Development
    • Testing Services
  • Careers
    • Careers Homepage
    • Get To Know Us
    • Engineering @ Sumerge
    • Our Culture
    • Benefits & Wellbeing
    • Job Openings
    • Graduate Programs
  • Contact Us
  • About Us
    • Who We Are
    • Our Work
    • Our Clients
    • Our Partners
    • Our Blog
    • News & Events
    • Insights
  • Solutions

    Analytics & Data Management

    Big DataBusiness AnalyticsData IntegrationData Warehousing

    Digital Business Automation

    Advanced Case ManagementBusiness Rules ManagementBusiness Process ManagementRobotic Process Automation

    Connectivity & System Integration

    Agile IntegrationAPI ManagementEnterprise Service Bus

    Enterprise Content Management

    Content Capturing & ImagingEnterprise Content Management

    Enterprise Portal & Mobility

    Digital Customer ExperienceDigital Workplace

  • Industry Solutions

    • Banking >
    • Government >

    Digital Banking Transformation

    Business Process Management

    Business Rules Management

    Checks Collection & Clearing

    Counter Fraud Management

    Customer Due Diligence

    Customer Onboarding

    Daily Vouchers Management

    Debt Collections & Recovery

    Instant Payment Network Gateway

    Enterprise Content Management

    Enterprise Service Bus

    Smart Analytics

    Trade Finance Automation

    Digital Government Transformation

    Business Analytics

    Business Process Management

    Correspondence Management

    Documents & Records Management

    Enterprise Service Bus

    Pensions & Social Programs

    Social Collaboration Portal

    Strategy Management

    Utility Billing

  • Services
    • Cloud Apps & Microservices
    • IT Consultancy
    • Application Development
    • Testing Services
  • Careers
    • Careers Homepage
    • Get To Know Us
    • Engineering @ Sumerge
    • Our Culture
    • Benefits & Wellbeing
    • Job Openings
    • Graduate Programs
  • Contact Us
Architecture for 2 Phase Password Reset Using OTP

Architecture for 2 Phase Password Reset Using OTP

  • Posted by Yomna Anwar
  • On May 22, 2022

Password reset is among the most common flows implemented in various kinds of software solutions, and it usually consists of 2 steps:

 

  • Challenge   

The process of submitting a proof of identification for the user, like sending a code to an email or phone number previously registered for that user, then validating the user by checking the code sent against the one input by the user.

 

  • Reset

The process following the success of the challenge, which includes submitting the new password.

 

 

Factors to consider

 

• One Time Password (OTP) can only be issued directly to the phone number and checked once by a system outside our scope.

• Password reset endpoint must be protected against unauthorized requests, therefore a password reset request must include a proof that the sender previously succeed in an OTP challenge related to this account.

 

Approach #1: Token table:

 

We can safely conclude that a very valid approach would be to use a session like architecture, where a session is created when the OTP is validated and a token is issued and stored to the database, this token also contains metadata about the session and its lifetime as well as the user account reference to avoid exploits where an issued token may be used to reset password for another user.

 

 

 

Session token tables are the industry standard for system managed state-fullness, and it also maintains a well-tested, rock-solid dependability in that regard.

 

 

But the hassle of managing a database IO and purging a heavily used table can be an overhead for many scenarios, comes in the next approach.

 

Approach #2: Single payload approach:

 

The single payload approach is even more logical than the token table approach, instead it reduces a call, and combine it with both.

 

 

In other words, the challenge response is stored in memory until the time to send the password reset request, then it’d be sent alongside for validation.

 

 

 

This approach is very much simpler and very dependable as it does not leak information via brute force, but lacks the ability to validate beforehand the challenge for input errors, this can be quite frustrating from a UX point of view.

 

 

Approach #3: Stateless token generator:

 

A stateless password reset token generator is an approach that combines the benefits of both previous ones, by using data that changes alongside the password. We can generate a token that is highly coupled to the password, which will automatically vanish from the system with the password change.

 

This approach relies on information like last password change date and the password hash itself. It uses such fields as components to generate a token, which will always be the same until the password is actually changed.

 

 

However, when relying on this approach many factors are to be considered.

1.  After the password reset challenge is successful and the token is issued, the account in question must be locked until the password update is concluded, meaning logging in to that account must be disabled until the password is actually updated.

2. Relying on as many fields as possible to issue the token is more than crucial to protect the hashed password as well as the algorithms themselves from any type of exposure

 

Conclusion:

 

Finally, to conclude, this process is highly variable in nature, and has many forces at play, therefore none of the solutions illustrated can be said to be one size fits all. However, each one of them has its strengths and weaknesses. The most important factor in the design of such solutions, is to ensure the utmost priority for the security of the password reset process, while maintaining the other guidelines such as performance and user experience as it fits.

 

 
Recent Blog Posts
  • Event Streaming: Enhancing Efficiency in Banking 
  • Your Guide To Integration Modernization
  • APIs: Transforming Chaos into Order
  • Event Streaming Simplified
  • Unlocking the Power of Spring Data JPA
Categories
  • Careers
  • Webinars
  • blog
    • Educational
  • Technology & Business
    • Digital Business Automation
    • /Modernization & Cloud Native Apps
    • Banking
    • Agile Integration
  • Software Engineering
    • Application Servers
    • Application Testing
    • Business Analysis
    • Frontend
    • Microservices
    • Uncategorized
  • Blog Posts
  • News & Events
  • Featured

Sumerge's Participation in Red Hat's First Healthcare Event in Saudi Arabia

Previous thumb

Protocol Signing with Coventry University - TKH

Next thumb
Scroll
Follow us

Significant change, positive impact and passion are our fuel. We have a unique culture reflecting the way we think and act. A culture that encourages freedom and responsibility, high performance, customer centricity and innovation.

Global Locations

Egypt

Saudi Arabia

United States

About us

Who We Are
Our Work
Our Clients
Careers
News & Events
Insights

Services

Cloud Apps & Microservices
Application Development
Consultancy
Testing Services

Solutions

Analytics & Data Management
Business Process Automation
Agile Integration
Enterprise Content Management
Enterprise Portal & Mobility

Industries

Banking
Government

Latest Blogs
  • Database Events & Triggers
    December 14, 2022
  • Design Patterns
    August 23, 2022
Copyright Ⓒ 2024 Sumerge. All rights reserved.
  • Blog
  • |
  • Support
  • |
  • Contact Us
  • |
  • Privacy Policy
Sumerge
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}

     

    Book A Free Consultation Session