Quick revision
The short answer
We separate staying signed in from being allowed to do anything. A long-lived, revocable and rotated credential, persistent remember-me or a refresh token, keeps the user recognised for up to 90 days, but payments and changes to personal details always require fresh authentication. Long logins are tied to device signals, listed so users can revoke them, and ended on password change, suspicious activity and long inactivity, within whatever limits the applicable regulations set.
What to remember
In this answer, we met a 90-day sign-in request by separating recognition from full access: a revocable, rotating long-lived credential such as persistent remember-me or rotated refresh tokens keeps the user recognised, while payments and changes to details require step-up authentication. We tied long logins to device signals, let users see and revoke devices, ended them on password change, suspicious activity and inactivity, and kept the limits configurable to match regulation.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
We separate staying signed in from being allowed to do anything. A long-lived, revocable and rotated credential, persistent remember-me or a refresh token, keeps the user recognised for up to 90 days, but payments and changes to personal details always require fresh authentication. Long logins are tied to device signals, listed so users can revoke them, and ended on password change, suspicious activity and long inactivity, within whatever limits the applicable regulations set.
Why this question is asked
Product requests like this are common, and a flat refusal rarely survives the next meeting. The useful senior answer shows how to give the business most of what it wants while keeping the risky operations protected. Interviewers ask it because it touches remember-me, token rotation, step-up authentication and regulation at once. In this answer, we will separate recognition from authorisation, choose the long-lived credential, add step-up for sensitive actions, bind the login to the device and give users control, decide when the login ends, and check the regulatory limits.
1Recognition Is Not the Same as Full Access
The key idea is that 'staying signed in' can mean different levels of trust. After 60 days without typing a password, the application can be confident it is talking to the same browser it saw before. It cannot be confident that the person at the keyboard is the account owner: the laptop may be shared, stolen or left unlocked.
So we design two levels. A recognised user can see balances and recent activity, receive messages and use low-risk features. A freshly authenticated user, who proved their identity in the last few minutes, can make payments, add payees, change contact details or passwords. The 90-day promise applies to the first level only, and that is usually what product actually wants: customers should not be asked to log in just to check something.
| Action | Recognised (up to 90 days) | Freshly authenticated |
|---|---|---|
| View balance and transactions | yes | yes |
| Read messages, download statements | yes | yes |
| Pay an existing payee | step-up required | yes |
| Add a payee or change limits | step-up required | yes, with a second factor |
| Change email, phone or password | step-up required | yes, with a second factor |
2Choosing a Long-Lived Credential That Can Be Revoked
The long-lived credential must be something we can revoke and that changes as it is used, so a copied value stops working. In a server-rendered Spring application that is persistent remember-me: a series and token in a database table, with the token rotated on every use and theft detected when an old token appears. In a single-page or mobile client using OAuth 2.0, it is a refresh token issued by the identity provider with rotation enabled, so each refresh returns a new refresh token and invalidates the old one.
The access itself stays short. The HTTP session or the access token lasts minutes, and the long-lived credential silently renews it. That way, if we revoke the long-lived credential, the user is out within minutes.
recentLogin() here stands for our own AuthorizationManager that checks how long ago the user last presented a password or second factor in this session; Spring Security's fullyAuthenticated() is the simpler built-in version that only rejects remember-me logins.
3Step-Up Authentication for Sensitive Operations
Step-up means asking for proof again at the moment it matters. When a recognised user opens the payment page, we redirect to a short re-authentication: their password plus a second factor, or a passkey, which is quicker and phishing resistant. After success we record the time and the factors used in the session and send the user back to the payment.
For a banking-related application, payments themselves often need more than a recent login: a confirmation in the mobile app or a signed challenge that shows the amount and payee. That protects against an attacker who has taken over the browser session itself.
- Request /payments/newuser recognised by remember-me
- Authenticated in the last 5 minutes?YesShow the payment formNoRedirect to step-up
- Password plus second factor, or passkeyrecord time and factors in the session
- Step-up succeeded?YesBack to the payment formNoStay recognised only, notify on repeated failures
- Confirm amount and payeesigned or in-app confirmation
5 steps in order. Play them, or step through them one at a time.
4Binding to the Device and Giving Users Control
A long login should belong to one device. When we issue the credential, we record signals such as the device type, browser, approximate location and a device identifier we store in the browser. If the credential later arrives with very different signals, for example from another country and another browser within an hour, we treat it as suspicious and require a full login. Signals are not proof, and they will sometimes be wrong, so they raise the bar rather than block on their own.
Users should see their remembered devices, with the last use and location, and be able to sign out any of them. This also helps support: a customer who lost a phone can end that login themselves.
5When the Long Login Ends
Ninety days is a maximum, not a promise. The credential ends earlier on a password change (delete all remember-me rows or revoke all refresh tokens of the user), on suspicious activity flagged by fraud systems, on explicit sign-out, and after a period of inactivity, say 30 days without any visit. An absolute limit of 90 days from the last full login stops rotation from extending the login forever, because otherwise a token used every day would never expire.
6Checking the Regulatory Limits
Banking-related services often fall under rules about strong customer authentication and session timeouts. Some regulations require a second factor for payments regardless of how the user logged in, and some limit how long a user may access account information without authenticating again. These rules vary by country and change over time, so we involve compliance early and design the timeouts as configuration, so a regulator's limit becomes a property change, not a redesign.
7Follow-up questions
Why not simply set the session timeout to 90 days?
Because a session that long cannot be rotated, is rarely revocable per device, and gives full access to anyone who gets hold of the cookie. Separating a short session from a long, rotating, revocable credential gives the same convenience with far less risk.
How do we know the step-up was recent?
We record the time and the factors of the last full authentication in the session or in the token claims, for example auth_time and amr in OIDC, and the authorisation rule compares that time with the limit for the operation.
What tells us the feature is working well?
Fewer full logins per active user, unchanged or lower fraud and account takeover rates, and a low rate of step-up failures or abandoned payments. If step-up annoys users too often, passkeys usually reduce the friction more than loosening the rules.
8Conclusion
In this answer, we met a 90-day sign-in request by separating recognition from full access: a revocable, rotating long-lived credential such as persistent remember-me or rotated refresh tokens keeps the user recognised, while payments and changes to details require step-up authentication. We tied long logins to device signals, let users see and revoke devices, ended them on password change, suspicious activity and inactivity, and kept the limits configurable to match regulation.
Open with
I would say yes to staying signed in, but not to staying fully authorised. The user can be recognised for up to 90 days, which covers what product actually wants: checking balances and activity without logging in every time.
Then, if they want more
For that I would use a credential that is revocable and rotates, so persistent remember-me in a server-rendered app, or rotated refresh tokens from the identity provider for a single-page or mobile client, with short sessions or access tokens renewed by it.
Sensitive operations, such as payments, adding payees, or changing email, phone or password, require step-up authentication: a recent password plus second factor, or a passkey, checked by an authorisation rule on the time of the last full authentication, and payments may need their own confirmation.
I would bind the long login to device signals and treat big changes as suspicious, and show users their remembered devices so they can revoke them. The login ends on password change, on fraud signals, on sign-out, after something like 30 days of inactivity, and at most 90 days after the last full login so rotation cannot extend it forever.
Finally I would check with compliance, because banking regulations often set limits on authentication and session lifetime, and keep those limits as configuration.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Security reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Product wants users to stay signed in for 90 days on a banking-related web application....": https://scrivio-interview-library.netlify.app/spring-boot/authentication/c9b4bbf3a7/