Test Series - spring

Test Number 15/20

Q: Session scope attribute to display error message.
A. SPRING_SECURITY_FIRST_EXCEPTION
B. SPRING_SECURITY_LAST_EXCEPTION
C. SPRING_SECURITY_EXCEPTION
D. SPRING_SECURITY_LAST_ERROR
Solution: If an error has occurred, you will have to display the error message by accessing the session scope attribute SPRING_SECURITY_LAST_EXCEPTION, which stores the last exception for the current user.
Q: Logout service is configured by:-
A. logout
B. login
C. logout-basic
D. logout_basic
Solution: The logout service provides a handler to handle logout requests. It can be configured via the logout element.
Q: Element which redirects to a specific URL on logout.
A. logout-success
B. logout-success_url
C. logout-url
D. logout-success-url
Solution: By default, a user will be redirected to the context path root when the logout succeeds, but sometimes, you may wish to direct the user to another URL.
Q: Anonymous login services can be configured by:-
A. anonymous-basic
B. anonymous
C. anonymous-target
D. none of the mentioned
Solution: The anonymous login service can be configured via the anonymous element.
Q: Remember-me support can be configured by:-
A. remember-me
B. remember-me-basic
C. remember-basic
D. none of the mentioned
Solution: Remember-me support can be configured via the remember-me element.
Q: By default, Remember-me encodes the username, password, remember-me expiration time, and a private key as a token, and stores it as a cache in the user’s browser.
A. True
B. False
C. 1
D. 0
Solution: Remember-me stores as cookie in the user’s browser not as cache.
Q: Spring Security algorithms to secure password.
A. MD5
B. SHA
C. All of the mentioned
D. None of the mentioned
Solution: Spring Security supports several algorithms for encoding passwords (including MD5 and SHA) and provides built-in password encoders for these algorithms.
Q: Connection of database with Apache derby server requires.
A. Derby client.jar
B. Spring JDBC support
C. None of the mentioned
D. All of the mentioned
Solution: To connect to a database in the Apache Derby server, you need the Derby client .jars, as well as the Spring JDBC support.
Q: You can specify the statements for querying a user’s information and authorities in the users-by-username-query and authorities-by-username-query attributes.
A. True
B. False
C. 1
D. 0
Solution: Spring Security also supports using custom SQL statements to query a legacy database for user details.
Q: Utility to calculate MD5 digests for your password.
A. CheckSum
B. BeanShell
C. Jacksum
D. None of the mentioned
Solution: Jacksum, which you can download from http://sourceforge.net/projects/jacksum/ and extract to a directory of your choice. Then execute the following command to calculate a digest for a text:
java -jar jacksum.jar -a md5 -q “txt:secret”

You Have Score    /10