Package org.ejbca.core.model.authorization

Examples of org.ejbca.core.model.authorization.AuthenticationFailedException


      raauthorized = new Boolean[AUTHORIZED_FIELD_LENGTH];
    }

    private void commonInit() throws Exception {
      if ((administrator == null) && (certificates == null)) {
        throw new AuthenticationFailedException("Client certificate required.");
      } else if (certificates != null) {
        administrator = userAdminSession.getAdmin(certificates[0]);       
      } // else we have already defined an administrator, for example in initialize_errorpage

      globaldataconfigurationdatahandler = new GlobalConfigurationDataHandler(administrator, globalConfigurationSession, authorizationSession);       
View Full Code Here


    /* Sets the current user and returns the global configuration */
    public GlobalConfiguration initialize(HttpServletRequest request, String resource) throws Exception{
     
      certificates = (X509Certificate[]) request.getAttribute( "javax.servlet.request.X509Certificate" );
      if(certificates == null || certificates.length == 0) {
        throw new AuthenticationFailedException("Client certificate required.");
      }

     
      String userdn = "";
     
View Full Code Here

        // Check Validity
        try {
            certificate.checkValidity();
        } catch (Exception e) {
          String msg = intres.getLocalizedMessage("authentication.certexpired", CertTools.getNotAfter(certificate).toString());             
            throw new AuthenticationFailedException(msg);
        }
        if (requireAdminCertificateInDatabase) {
            // TODO: Verify Signature on cert? Not really needed since it's one of ou certs in the database.
            // Check if certificate is revoked.
            boolean isRevoked = isRevoked(CertTools.getIssuerDN(certificate),CertTools.getSerialNumber(certificate));
            if (isRevoked) {
                // Certificate revoked or missing in the database
              String msg = intres.getLocalizedMessage("authentication.revokedormissing");             
                throw new AuthenticationFailedException(msg);
            }
        } else {
          // TODO: We should check the certificate for CRL or OCSP tags and verify the certificate status
        }
    }
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.authorization.AuthenticationFailedException

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.