Class PlayerAuthenticationService
Object
PlayerAuthenticationService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(String name, SecurityContext context) This method should be called to verify that the target of a certain action is indeed a proper authenticated user.authenticateGuildMaster(String name, SecurityContext context) Authenticates a guildmaster.protected EntityManagerReturns the entity manager of JPA.getPlayerName(SecurityContext context) Provides the player who is logged in during this session.voidlogoff(HttpServletRequest requestContext) voidsetEntityManager(EntityManager em)
-
Constructor Details
-
PlayerAuthenticationService
public PlayerAuthenticationService()
-
-
Method Details
-
getEntityManager
protected EntityManager getEntityManager()Returns the entity manager of JPA. This is defined in build/web/WEB-INF/classes/META-INF/persistence.xml.- Returns:
- EntityManager
-
authenticate
This method should be called to verify that the target of a certain action is indeed a proper authenticated user.- Parameters:
name- the name to identify the person- Returns:
- the User identified by the name.
- Throws:
WebApplicationException- NOT_FOUND, if the user is either not found or is not a proper user. BAD_REQUEST if an unexpected exception crops up or provided info is really not proper. UNAUTHORIZED if session passwords do not match.
-
authenticateGuildMaster
-
getPlayerName
Provides the player who is logged in during this session.- Returns:
- name of the player
-
logoff
public void logoff(HttpServletRequest requestContext) -
setEntityManager
public void setEntityManager(EntityManager em)
-