@Override public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
KeyStore trustStore = getKeyStore( _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
@Deprecated protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return getKeyStore(storePath, storeType, storeProvider, storePassword); } /* ------------------------------------------------------------ */
@Override public UserIdentity login(String username, Object password, ServletRequest request) { UserIdentity user = super.login(username,password,request); if (user!=null) { HttpSession session = ((HttpServletRequest)request).getSession(true); Authentication cached=new SessionAuthentication(getAuthMethod(),user,password); session.setAttribute(SessionAuthentication.__J_AUTHENTICATED, cached); } return user; }
@Deprecated protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return getKeyStore(storePath, storeType, storeProvider, storePassword); } /* ------------------------------------------------------------ */
KeyStore trustStore = getKeyStore(null, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
@Deprecated protected KeyStore getKeyStore(InputStream storeStream, String storePath, String storeType, String storeProvider, String storePassword) throws Exception { return getKeyStore(storePath, storeType, storeProvider, storePassword); } /* ------------------------------------------------------------ */
KeyStore trustStore = getKeyStore( _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
KeyStore trustStore = getKeyStore(null, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
KeyStore trustStore = getKeyStore(null, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
KeyStore trustStore = getKeyStore(null, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
KeyStore trustStore = getKeyStore(null, _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }
KeyStore trustStore = getKeyStore( _trustStorePath, _trustStoreType, _trustStoreProvider, _trustStorePassword == null ? null :_trustStorePassword.toString()); Collection<? extends CRL> crls = loadCRL(_crlPath); CertificateValidator validator = new CertificateValidator(trustStore, crls); validator.validate(certs); UserIdentity user = login(username, credential, req); if (user!=null) return new UserAuthentication(getAuthMethod(),user);
public Authenticator getAuthenticator(Server server, ServletContext context, AuthConfiguration configuration, IdentityService identityService, LoginService loginService) { String auth=configuration.getAuthMethod(); Authenticator authenticator=null; if (auth==null || Constraint.__BASIC_AUTH.equalsIgnoreCase(auth)) authenticator=new BasicAuthenticator(); else if (Constraint.__DIGEST_AUTH.equalsIgnoreCase(auth)) authenticator=new DigestAuthenticator(); else if (Constraint.__FORM_AUTH.equalsIgnoreCase(auth)) authenticator=new FormAuthenticator(); else if ( Constraint.__SPNEGO_AUTH.equalsIgnoreCase(auth) ) authenticator = new SpnegoAuthenticator(); else if ( Constraint.__NEGOTIATE_AUTH.equalsIgnoreCase(auth) ) // see Bug #377076 authenticator = new SpnegoAuthenticator(Constraint.__NEGOTIATE_AUTH); if (Constraint.__CERT_AUTH.equalsIgnoreCase(auth)||Constraint.__CERT_AUTH2.equalsIgnoreCase(auth)) authenticator=new ClientCertAuthenticator(); return authenticator; }