QA
Intermediate LevelAuthentication & Authorization

How does Contextual Risk-Based Authentication adjust security policies based on IP/Location/Device?

❓ Interview Prompt: Explain Risk-Based Authentication (RBA), risk scoring engines, impossible travel velocity, and adaptive MFA challenges.

Static authentication treats a login request from a user's normal home laptop the same as a login request coming from an anonymous Tor exit node in a foreign country. Contextual Risk-Based Authentication (RBA) dynamically assesses risk.

Risk Signals Evaluated:

1
Impossible Travel Velocity: User logs in from New York, then 10 minutes later logs in from Tokyo.
2
New Device / User-Agent Fingerprint: Login from an unrecognized browser/device pair.
3
Reputational IP Score: Login from known botnets, VPNs, or datacenter IP blocks.

Adaptive Policy Actions:

•
Low Risk (Score < 20): Grant seamless access.
•
Moderate Risk (20 - 70): Trigger mandatory Step-Up 2FA / WebAuthn prompt.
•
High Risk (Score > 70): Block access immediately and email security alert.

Code Implementation Example

typescript
function evaluateLoginRiskScore(ctx: { isNewDevice: boolean; isTorIp: boolean; milesPerHourTravelled: number }): 'ALLOW' | 'MFA_REQUIRED' | 'BLOCK' {
  let score = 0;
  if (ctx.isNewDevice) score += 30;
  if (ctx.isTorIp) score += 60;
  if (ctx.milesPerHourTravelled > 600) score += 80; // Impossible travel!

  if (score >= 80) return 'BLOCK';
  if (score >= 30) return 'MFA_REQUIRED';
  return 'ALLOW';
}
💡Contextual risk engine scoring login attempts and assigning adaptive security policies.
🎯 Interview Key Takeaway

Contextual risk authentication dynamically triggers MFA challenges or blocks logins based on real-time threat signals.

#Risk-Based Auth#Contextual Security#Adaptive MFA#Intermediate
Back to all Authentication & Authorization Questions→

More Authentication & Authorization Interview Questions

Beginner LevelAuthentication & Authorization

Compare JWT Token Authentication versus Stateful Sessions, and explain OAuth 2.0 PKCE flow.

Beginner LevelAuthentication & Authorization

What is the fundamental difference between Authentication (AuthN) and Authorization (AuthZ)?

Beginner LevelAuthentication & Authorization

Why should passwords never be stored in plain text and how do bcrypt and Argon2id work?