Authentication interview questions
JSON Web Tokens (JWT), JWT Signatures, Plaintext Passwords, Salting and BCrypt
81 questions with answers and explanations · 81 flashcards
Questions (page 1 of 2)
- What role does the header play in a JWT token?Multiple choiceMedium
- In the context of JWT, what is the primary purpose of the signature?Multiple choiceEasy
- How can a Java developer verify the signature of a JWT using HMAC SHA-256?Multiple choiceMedium
- How would you explain a significant consequence of using stateless JWT tokens for authentication in an interview?Multiple choiceHard
- Which statement about JWT payloads is correct?Multiple choiceEasy
- Which statement best describes the use of CSRF tokens in web applications?Multiple choiceHard
- Why is using BCrypt preferable over a fast hashing algorithm like SHA-256 for password hashing?Multiple choiceEasy
- Which aspect of JWT usage can lead to vulnerabilities if not properly managed?Multiple choiceHard
- In the context of Spring Security, why is it important to add a CSRF token to forms?Multiple choiceMedium
- Which part of a JWT is responsible for ensuring data integrity and preventing tampering?Multiple choiceMedium
- Which token-lifecycle design best limits damage if an access token is stolen?Multiple choiceMedium
- Which element in a JWT contains the algorithm details used for signing?Multiple choiceEasy
- Why do teams use JWTs over traditional session-based authentication in production code?Multiple choiceMedium
- Which OWASP Top 10 vulnerability is addressed by using parameterized queries?Multiple choiceEasy
- How does a server verify the integrity of a JWT when using HMAC SHA-256?Multiple choiceHard
- Which OWASP vulnerability does using HTML encoding help mitigate?Multiple choiceMedium
- How would you explain a significant risk of storing a JWT in localStorage in a browser context in an interview?Multiple choiceHard
- Which strategy is best for storing JWT secrets securely in a Spring Boot application?Multiple choiceHard
- Why is using a fast hashing algorithm like MD5 considered insecure for storing passwords?Multiple choiceEasy
- Why does a CSRF token matter in practice?Multiple choiceEasy
- In the context of JWTs, which of the following statements is true about the Signature part?Multiple choiceEasy
- What role does the Header play in a JWT?Multiple choiceEasy
- Which part of a JWT is used to verify its integrity?Multiple choiceMedium
- How would you explain a potential risk of using JWT tokens without proper expiration management in an interview?Multiple choiceHard
- When implementing stateless authentication using JWTs, how can a server manage user logout effectively?Multiple choiceHard
- What are the three parts of a JSON Web Token (JWT)?Multiple choiceEasy
- Which Java library is commonly used to create and verify JWTs in Spring applications?Multiple choiceMedium
- Which component in the JWT Header specifies the algorithm used to sign the token?Multiple choiceEasy
- Why is using fast hashing algorithms like MD5 for passwords a security problem?Multiple choiceMedium
- Why does adding a 'salt' to a password before hashing help in practice?Multiple choiceMedium
- Why is it important to store passwords using hash functions instead of plaintext?Multiple choiceEasy
- In a JWT, why should the secret key used for signing be kept secure?Multiple choiceMedium
- Why does a Signature in a JWT matter in practice?Multiple choiceMedium
- Why is it useful to adding a salt to a password before hashing it?Multiple choiceMedium
- In Spring Security, what is the role of the filter chain?Multiple choiceMedium
- How does BCrypt help mitigate the risk of brute-force attacks on passwords?Multiple choiceHard
- How can HTML encoding help prevent stored XSS attacks in a Java web application?Multiple choiceHard
- Why is it beneficial to use stateless JWTs instead of stateful sessions in a microservices architecture?Multiple choiceEasy
- Why is a 30-day access token usually a security risk?Multiple choiceMedium
- Why does a PreparedStatement in preventing SQL Injection attacks matter in this design?Multiple choiceMedium
- Why are prepared statements recommended for database interactions in Java?Multiple choiceMedium
- In a JWT, which part contains the information about the user's roles and permissions?Multiple choiceMedium
- Which of the following is a potential consequence of storing passwords in plaintext?Multiple choiceHard
- In the context of JWT, what role does the Payload play?Multiple choiceEasy
- How would you explain a common method to prevent Cross-Site Request Forgery (CSRF) attacks in web applications in an interview?Multiple choiceEasy
- How does the 'Work Factor' in BCrypt protect against brute-force attacks?Multiple choiceMedium
- Why is HTML encoding important for preventing stored XSS attacks?Multiple choiceMedium
- In the context of Spring Security, what is the primary role of the 'AuthenticationManager'?Multiple choiceHard
- Why is it important for a JWT to have a short expiration time?Multiple choiceMedium
- In Spring Security, what is the primary function of the filter chain?Multiple choiceHard