Package javax.security.auth.message

Examples of javax.security.auth.message.AuthException


         }
              
      }
      catch (Exception e)
      {
         throw new AuthException(e.getLocalizedMessage());
      }
      return true;
   }
View Full Code Here


            lm.login();
            lm.commit();
         }
         catch (Exception e)
         {
            throw new AuthException(e.getLocalizedMessage());
         }
      }
      else
      {
         return validate(clientSubject, messageInfo) ? AuthStatus.SUCCESS : AuthStatus.FAILURE;
View Full Code Here

                log.tracef("Request body too big to save during authentication");
                try {
                    response.sendError(HttpServletResponse.SC_FORBIDDEN, sm.getString("authenticator.requestBodyTooBig"));
                } catch (IOException e) {
                    log.errorf("Caught Exception in Form authentication: %s", e.getLocalizedMessage());
                    throw new AuthException(e.getLocalizedMessage());
                }
                return (AuthStatus.FAILURE);
            }
            forwardToLoginPage(request, response, config);
            return (AuthStatus.SEND_CONTINUE);
View Full Code Here

                                }
                                return ctor;
                            }
                        });
            } catch (java.security.PrivilegedActionException pae) {
                AuthException ae = new AuthException();
                ae.initCause(pae.getCause());
                throw ae;
            }
        }
    }
View Full Code Here

                                        InvocationTargetException {
                                    return (M) ctor[j].newInstance(ARGS);
                                }
                            }));
                } catch (PrivilegedActionException pae) {
                    AuthException ae = new AuthException();
                    ae.initCause(pae.getCause());
                    throw ae;
                }
            }
        }
        return list.toArray(template);
View Full Code Here

                if (requiredType.isAssignableFrom(supportedType)) {
                    supported = true;
                }
            }
            if (!supported) {
                throw new AuthException("module does not support message type: " + requiredType.getName());
            }
        }
    }
View Full Code Here

            getLc();
            JNDIClient ejbClient = new JNDIClient(providerUrl);
            loginEJB = (JaasEjb) ejbClient.lookup(jndi);
        } catch (LoginException ex) {
            LOGGER.severe("Exception d'init SAM" + ex.toString());
            AuthException ae = new AuthException();
            ae.initCause(ex);
            throw ae;
        }
    }
View Full Code Here

   throws AuthException
   {
      //Control Flag behavior
      boolean encounteredRequiredError = false;
      boolean encounteredOptionalError = false;
      AuthException moduleException = null;
      AuthStatus overallDecision = AuthStatus.FAILURE;
     
      int length = modules.size();
      for(int i = 0; i < length; i++)
      {
         ServerAuthModule module = (ServerAuthModule)modules.get(i);
         ControlFlag flag = (ControlFlag)this.controlFlags.get(i);
         AuthStatus decision = AuthStatus.FAILURE;
         try
         {
            decision = module.validateRequest(messageInfo, clientSubject, serviceSubject);
         }
         catch(Exception ae)
         {
            decision = AuthStatus.FAILURE;
            if(moduleException == null)
               moduleException = new AuthException(ae.getMessage());
         }
        
         if(decision == AuthStatus.SUCCESS)
         {
            overallDecision =  AuthStatus.SUCCESS;
            //SUFFICIENT case
            if(flag == ControlFlag.SUFFICIENT && encounteredRequiredError == false)
               return AuthStatus.SUCCESS;
            continue; //Continue with the other modules
         }
         //Go through the failure cases
         //REQUISITE case
         if(flag == ControlFlag.REQUISITE)
         {
            if(trace)
               log.trace("REQUISITE failed for " + module);
            if(moduleException == null)
               moduleException = new AuthException("Auth  failed");
            else
               throw moduleException;
         }
         //REQUIRED Case
         if(flag == ControlFlag.REQUIRED)
         {
            if(trace)
               log.trace("REQUIRED failed for " + module);
            if(encounteredRequiredError == false)
               encounteredRequiredError = true;
         }
         if(flag == ControlFlag.OPTIONAL)
            encounteredOptionalError = true;
      }
     
      //All the authorization modules have been visited.
      String msg = getAdditionalErrorMessage(moduleException);
      if(encounteredRequiredError)
         throw new AuthException("Auth Failed:"+ msg);
      if(overallDecision == AuthStatus.FAILURE && encounteredOptionalError)
         throw new AuthException("Auth Failed:" + msg);
      if(overallDecision == AuthStatus.FAILURE)
         throw new AuthException("Auth Failed:Denied.");
      return AuthStatus.SUCCESS;
   }
View Full Code Here

         {
            loginContext.logout();
         }
         catch (LoginException e)
         {
            throw new AuthException(e.getLocalizedMessage());
         }
   }
View Full Code Here

         return true;
      }
      catch (Exception e)
      {
         log.trace("Exception in validate:",e);
         throw new AuthException(e.getLocalizedMessage());
      }  
   }
View Full Code Here

TOP

Related Classes of javax.security.auth.message.AuthException

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.