com.ibm.wsspi.security.common.auth.module

Class IdentityAssertionLoginModule

  1. java.lang.Object
  2. extended bycom.ibm.wsspi.security.common.auth.module.IdentityAssertionLoginModule
All implemented interfaces:
javax.security.auth.spi.LoginModule

  1. public class IdentityAssertionLoginModule
  2. extends java.lang.Object
  3. implements javax.security.auth.spi.LoginModule

Identity Assertion login module

A principal will be logged in if a trust is established. This login module considers trust to be established if the shared state contains a Map called com.ibm.wsspi.security.common.auth.module.IdentityAssertionLoginModule.state. The Map should contain the following variables:

If all the variables are provided in the shared state then the identity be logged in.

Since:
1.0

Constructor Summary

Constructor and Description
IdentityAssertionLoginModule()

Method Summary

Modifier and Type Method and Description
  1. boolean
abort()
Abort the authentication (second phase).
  1. boolean
commit()
Commit the authentication (phase 2).
  1. void
initialize(javax.security.auth.Subject subject,javax.security.auth.callback.CallbackHandler callbackHandler,java.util.Map sharedState,java.util.Map options)
Initialize this login module.
  1. boolean
login()
Method to authenticate a Subject (first phase).
  1. boolean
logout()
Logout the user
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

IdentityAssertionLoginModule

  1. public IdentityAssertionLoginModule( )

Method Detail

initialize

  1. public void initialize(javax.security.auth.Subject subject,
  2. javax.security.auth.callback.CallbackHandler callbackHandler,
  3. java.util.Map sharedState,
  4. java.util.Map options)

Initialize this login module.

This is called by the LoginContext after this login module is instantiated. The relevant information is passed from the LoginContext to this login module. If the login module does not understands any of the data stored in the sharedState and options parameters, they can be ignored.

Specified by:
initialize in interface javax.security.auth.spi.LoginModule
Parameters:
subject - The subject to be authenticated.
callbackHandler - A CallbackHandler for communicating with the end user to gather login information (e.g., username and password).
sharedState - The state shared with other configured login modules.
options - The options specified in the login configuration for this particular login module.

login

  1. public boolean login()
  2. throws WSLoginFailedException

Method to authenticate a Subject (first phase).

This method authenticates a Subject. It uses the Map stored in the shared state property com.ibm.wsspi.security.common.auth.module.IdentityAssertionLoginModule.state. The com.ibm.wsspi.security.common.auth.module.IdentityAssertionLoginModule.trusted key in the Map is used to determine trust. If true then trusted if false then it not trusted. When trust is established then the principal stored in either the com.ibm.wsspi.security.common.auth.module.IdentityAssertionLoginModule.principal or com.ibm.wsspi.security.common.auth.module.IdentityAssertionLoginModule.certificates key will contain the identity to login as.

Specified by:
login in interface javax.security.auth.spi.LoginModule
Returns:
true if the authentication succeeded, or false if this login module should be ignored.
Throws:
WSLoginFailedException - If the authentication fails.

commit

  1. public boolean commit()
  2. throws WSLoginFailedException
Commit the authentication (phase 2).

If the login module authentication attempted in phase 1 succeeded, then relevant principals and credentials are associated with the subject. If the authentication attempted in phase 1 failed, then this method removes/destroys any state that was originally saved.

Specified by:
commit in interface javax.security.auth.spi.LoginModule
Returns:
true if this LoginModule's own login and commit attempts succeeded, or false otherwise.
Throws:
WSLoginFailedException - if the commit fails

abort

  1. public boolean abort()
  2. throws javax.security.auth.login.LoginException
Abort the authentication (second phase).

This method is called if the LoginContext's overall authentication failed.

If this login module's authentication attempt succeeded, then this method cleans up the previous state saved in phase 1.

Specified by:
abort in interface javax.security.auth.spi.LoginModule
Returns:
false if this LoginModule's own login and/or commit attempts failed, and true otherwise.
Throws:
javax.security.auth.login.LoginException - if the abort fails

logout

  1. public boolean logout()
  2. throws javax.security.auth.login.LoginException
Logout the user

The principals and credentials are removed from the Shared state.

Specified by:
logout in interface javax.security.auth.spi.LoginModule
Returns:
true in all cases (this LoginModule should not be ignored).
Throws:
javax.security.auth.login.LoginException - if the logout fails