org.apache.deltaspike.security.api
Interface Identity

All Superinterfaces:
Serializable

public interface Identity
extends Serializable

Represents the identity of the current user, and provides an API for authentication and authorization.


Nested Class Summary
static class Identity.AuthenticationResult
           
 
Method Summary
 User getUser()
           
 boolean isLoggedIn()
          Simple check that returns true if the user is logged in, without attempting to authenticate
 Identity.AuthenticationResult login()
          Attempts to authenticate the user.
 void logout()
          Logs out the currently authenticated user
 

Method Detail

isLoggedIn

boolean isLoggedIn()
Simple check that returns true if the user is logged in, without attempting to authenticate

Returns:
true if the user is logged in

getUser

User getUser()

login

Identity.AuthenticationResult login()
Attempts to authenticate the user. This method raises the following events in response to whether authentication is successful or not. The following events may be raised during the call to login():

LoggedInEvent - raised when authentication is successful LoginFailedEvent - raised when authentication fails AlreadyLoggedInEvent - raised if the user is already authenticated

Returns:
AuthenticationResult returns SUCCESS if user is authenticated, FAILED if authentication FAILED, or EXCEPTION if an EXCEPTION occurred during authentication. These response values may be used to control user navigation. For deferred authentication methods, such as Open ID the login() method will return an immediate result of FAILED (and subsequently fire a LoginFailedEvent) however in these conditions it is the responsibility of the Authenticator implementation to take over the authentication process, for example by redirecting the user to a third party authentication service such as an OpenID provider.

logout

void logout()
Logs out the currently authenticated user



Copyright © 2011-2012 The Apache Software Foundation. All Rights Reserved.