Errai 3.0.1-SNAPSHOT

org.jboss.errai.security.shared.service
Interface AuthenticationService

All Known Implementing Classes:
PicketLinkAuthenticationService

public interface AuthenticationService

AuthenticationService service for authenticating users and getting their roles.

Author:
edewit@redhat.com

Method Summary
 User getUser()
          Get the currently authenticated user.
 boolean isLoggedIn()
           
 User login(String username, String password)
          Login with the given username and password, throwing an exception if the login fails.
 void logout()
          Log out the currently authenticated user.
 

Method Detail

login

User login(String username,
           String password)
Login with the given username and password, throwing an exception if the login fails.

Parameters:
username - The username to log in with.
password - The password to authenticate with.
Returns:
The logged in User.
Throws:
Implementations - should throw an AuthenticationException if authentication fails.

isLoggedIn

boolean isLoggedIn()
Returns:
True iff the user is currently logged in.

logout

void logout()
Log out the currently authenticated user. Has no effect if there is no current user.


getUser

User getUser()
Get the currently authenticated user.

Returns:
The currently authenticated user. Never returns null. If no user is logged in, returns User.ANONYMOUS.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.