Authentication & Authorisation Questions with Answers

29 practice questions on Authentication & Authorisation (Cyber Security) with answers and step-by-step solutions. Try 10 samples below, then practise all 29 free in the AptiNest app.

Sample questions

Question 1Easy

A JSON Web Token (JWT) consists of:

  1. Header, payload and signature
  2. Username, password and salt
  3. Cookie, session and cache
  4. Public key, private key and CA

Answer: A. Header, payload and signature

Explanation

The three parts are Base64URL-encoded and separated by dots.

Step-by-step solution

  1. A JWT is three Base64URL parts joined by dots.
  2. The first part is the header, which holds the algorithm and type.
  3. The middle part is the payload, and the last part is the signature.
  4. So a JWT is header, payload and signature.

Why the other options are wrong

  • B. A username, password and salt are not JWT parts.
  • C. Cookie, session and cache are browser or server concepts, not JWT parts.
  • D. A JWT does not contain CA keys or a private key.

Tip: JWT = header.payload.signature.

Question 2Easy

Multi-factor authentication (MFA) requires:

  1. Two passwords typed one after another
  2. Factors of different types
  3. Logging in from two browsers
  4. A longer single password

Answer: B. Factors of different types

Explanation

Factors come from different categories: something you know, have or are.

Step-by-step solution

  1. MFA needs more than one factor to log in.
  2. The factors must be of different types.
  3. Types are something you know, have or are.
  4. So the answer is: factors of different types.

Why the other options are wrong

  • A. Two passwords typed in sequence are both knowledge factors, so this is not MFA.
  • C. Logging in from two browsers adds no factor.
  • D. A longer password is still one knowledge factor.

Tip: MFA needs different factor types: know, have or are.

Question 3Easy

An OTP is:

  1. An operating time period
  2. An open transport protocol
  3. An online tax portal
  4. A one-time password

Answer: D. A one-time password

Explanation

OTPs are valid for a single login or transaction.

Step-by-step solution

  1. OTP stands for One-Time Password.
  2. It is valid for one login or transaction only.
  3. It is often sent by SMS or an app.

Why the other options are wrong

  • A. Not a real expansion.
  • B. Not a real expansion.
  • C. Not a real expansion.

Question 4Easy

A fingerprint scan is which type of authentication factor?

  1. Somewhere you are
  2. Something you know
  3. Something you are
  4. Something you have

Answer: C. Something you are

Explanation

Biometrics are inherence factors.

Step-by-step solution

  1. A fingerprint is a biological trait of the user.
  2. Biological traits are the inherence (something you are) factor.
  3. It is not a place, a secret or an item.
  4. So the answer is: something you are.

Why the other options are wrong

  • A. Somewhere you are refers to location, not a biometric trait.
  • B. A fingerprint is not something you know.
  • D. A fingerprint is not an item you carry.

Tip: Biometrics (fingerprint, face, iris) are always the 'something you are' factor.

Question 5Medium

In OAuth, "scopes" are used to:

  1. Limit what the access token allows
  2. Set the token's colour
  3. Measure network latency
  4. Encrypt the refresh token

Answer: A. Limit what the access token allows

Explanation

Scopes such as read:email restrict the token to the permissions the user approved.

Step-by-step solution

  1. Scopes name the permissions an app asks for, such as read:email.
  2. The user approves these scopes.
  3. The token then allows only those actions.
  4. So scopes limit what the access token allows.

Why the other options are wrong

  • B. Token colour is not a concept in OAuth.
  • C. Network latency is not measured by scopes.
  • D. Scopes do not encrypt the refresh token.

Tip: Scopes = permissions on a token. Fewer scopes means less damage if the token leaks.

Question 6Medium

What is the purpose of the exp claim in a JWT?

  1. Its expiry time
  2. Listing the user's friends
  3. Naming the signing algorithm
  4. Storing the user's password

Answer: A. Its expiry time

Explanation

Short expiry limits how long a stolen token can be used.

Step-by-step solution

  1. The exp claim is a time after which the token is invalid.
  2. It is stored as a numeric timestamp in the payload.
  3. A short expiry limits how long a stolen token works.
  4. So exp is the expiry time.

Why the other options are wrong

  • B. Friends lists are not stored in exp.
  • C. The signing algorithm is named in the header, not exp.
  • D. Passwords must never be stored in a JWT.

Tip: exp = expiry time. Check it on every request.

Question 7Medium

OAuth 2.0 is primarily a framework for:

  1. Hashing passwords
  2. Delegated authorisation
  3. Encrypting hard disks
  4. Compressing tokens

Answer: B. Delegated authorisation

Explanation

OAuth lets a user grant an app limited access to their resources on another service without sharing their password.

Step-by-step solution

  1. OAuth 2.0 lets a user grant an app limited access to resources.
  2. The access is delegated, so the user does not share a password.
  3. This is authorisation, not hashing or encryption.
  4. So the answer is: delegated authorisation.

Why the other options are wrong

  • A. OAuth does not hash passwords.
  • C. Disk encryption is outside OAuth.
  • D. Token compression is not the purpose of OAuth.

Tip: OAuth = authorisation (what an app may access). OIDC = authentication (who the user is).

Question 8Medium

Account lockout after several failed logins mainly protects against:

  1. Online brute-force attacks
  2. Cross-site scripting
  3. SQL injection in the login form
  4. Clickjacking of the login button

Answer: A. Online brute-force attacks

Explanation

Limiting attempts slows guessing; lockouts should be designed so attackers cannot easily lock out real users.

Step-by-step solution

  1. Account lockout stops further login attempts after several failures.
  2. Brute-force attacks try many passwords one after another online.
  3. Lockout slows or stops these guessing attacks.
  4. So lockout protects against online brute-force attacks.

Why the other options are wrong

  • B. Cross-site scripting is a script injection issue, not a login-attempt issue.
  • C. SQL injection is prevented with input handling, not lockout.
  • D. Clickjacking is a UI overlay attack and not addressed by lockout.

Tip: Lockout and rate limiting slow online guessing. Lockouts should not let attackers lock out real users easily.

Question 9Hard

"Sign in with [a large provider]" on a third-party website typically uses:

  1. Kerberos with smart cards
  2. FTP
  3. Plain HTTP basic authentication
  4. OpenID Connect

Answer: D. OpenID Connect

Explanation

OIDC (built on OAuth 2.0) lets the site obtain verified identity information from the provider.

Step-by-step solution

  1. 'Sign in with' a provider lets a third-party site verify the user's identity.
  2. This is done with OpenID Connect, built on OAuth 2.0.
  3. The site receives verified identity information in an ID token.
  4. So the answer is: OpenID Connect.

Why the other options are wrong

  • A. Kerberos with smart cards is an enterprise login system, not web social login.
  • B. FTP is a file transfer protocol.
  • C. Basic HTTP authentication is not used for social sign-in.

Tip: 'Sign in with' buttons are OIDC on top of OAuth 2.0.

Question 10Hard

Why should session IDs be regenerated after a user logs in?

  1. To avoid using HTTPS
  2. To prevent session fixation
  3. To make the session cookie smaller
  4. To speed up the database

Answer: B. To prevent session fixation

Explanation

If an attacker planted a known session ID before login, regenerating it ensures they cannot reuse it afterwards.

Step-by-step solution

  1. Session fixation tricks a user into using a session ID the attacker already knows.
  2. If the ID is not changed at login, the attacker can use it after the user logs in.
  3. Generating a new session ID at login cuts off the attacker's copy.
  4. So regeneration prevents session fixation.

Why the other options are wrong

  • A. HTTPS is still needed; regenerating IDs does not replace it.
  • C. Session ID size is not affected by regeneration in a way that matters here.
  • D. Regenerating the ID does not speed up the database.

Tip: Always issue a new session ID after login or privilege change.

Practise all 29 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Cyber Security topics · All topics