public static SSOToken datastoreLogin(String username,String password,String realm) throws Exception {
  AuthContext lc=new AuthContext(realm);
  AuthContext.IndexType indexType=AuthContext.IndexType.MODULE_INSTANCE;
  lc.login(indexType,"DataStore");
  Callback[] callbacks=null;
  while (lc.hasMoreRequirements()) {
    callbacks=lc.getRequirements();
    if (callbacks != null) {
      addLoginCallbackMessage(callbacks,username,password);
      lc.submitRequirements(callbacks);
    }
  }
  return (lc.getStatus() == AuthContext.Status.SUCCESS) ? lc.getSSOToken() : null;
}

public static SSOToken datastoreLogin ( String username , String password , String realm ) throws Exception { AuthContext lc = new AuthContext ( realm ) ; AuthContext . IndexType indexType = AuthContext . IndexType . MODULE_INSTANCE ; lc . login ( indexType , "DataStore" ) ; Callback [ ] callbacks = null ; while ( lc . hasMoreRequirements ( ) ) { callbacks = lc . getRequirements ( ) ; if ( callbacks != null ) { addLoginCallbackMessage ( callbacks , username , password ) ; lc . submitRequirements ( callbacks ) ; } } return ( lc . getStatus ( ) == AuthContext . Status . SUCCESS ) ? lc . getSSOToken ( ) : null ; }
perform a datastore module login .
