Package javax.naming

Examples of javax.naming.AuthenticationException


  public A() {
  }

  @View
  public void index() throws Exception {
    throw new AuthenticationException();
  }
View Full Code Here


/** @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a> */
public class A {

  public A() throws AuthenticationException {
    throw new AuthenticationException();
  }
View Full Code Here

                                .createAuthenticationProvider(ldapConfig);
                        Authentication authentication = authProvider
                                .authenticate(new UsernamePasswordAuthenticationToken(
                                        username, password));
                        if(authentication == null || !authentication.isAuthenticated()) {
                            throw new AuthenticationException("Cannot authenticate " + username);
                        }

                        provider.destroy(null);
                        info(new StringResourceModel(LDAPAuthProviderPanel.class.getSimpleName() +
                            ".connectionSuccessful", null).getObject());
View Full Code Here

                } else {
                    clientIdentity = securityService.login(realmName, user, pass);
                }
                ClientSecurity.setIdentity(clientIdentity);
            } catch (LoginException e) {
                throw (AuthenticationException) new AuthenticationException("User could not be authenticated: "+user).initCause(e);
            }
        }
    }
View Full Code Here

        return initCause(new RollbackException(), cause);
    }


    public static AuthenticationException newAuthenticationException(String message, Throwable cause) {
        return initCause(new AuthenticationException(message), cause);
    }
View Full Code Here

    public static AuthenticationException newAuthenticationException(String message, Throwable cause) {
        return initCause(new AuthenticationException(message), cause);
    }

    public static AuthenticationException newAuthenticationException(Throwable cause) {
        return initCause(new AuthenticationException(), cause);
    }
View Full Code Here

        AuthenticationResponse res = null;

        try {
            res = requestAuthorization(req);
        } catch (RemoteException e) {
            throw new AuthenticationException(e.getLocalizedMessage());
        }

        switch (res.getResponseCode()) {
            case ResponseCodes.AUTH_GRANTED:
                client = res.getIdentity();
                break;
            case ResponseCodes.AUTH_REDIRECT:
                client = res.getIdentity();
                server = res.getServer();
                break;
            case ResponseCodes.AUTH_DENIED:
                throw (AuthenticationException) new AuthenticationException("This principle is not authorized.").initCause(res.getDeniedCause());
        }
    }
View Full Code Here

 
  @Override
  public void authenticate(String username, String password) throws AuthenticationException {

    if(!USER.equals(username) || !PASSWD.equals(password)){
      throw new AuthenticationException("username or password invalid!");
    }
  }
View Full Code Here

TOP

Related Classes of javax.naming.AuthenticationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.