public void destroy() { super.destroy(); unregisterBypasser(auth); }
public void writeTo(DataOutput out) throws IOException { if (isAuthenticated()) { generateServiceTicket(); writeServiceTicketToSream(out); } }
public void readFrom(DataInput in) throws IOException, IllegalAccessException, InstantiationException { // This method is called from within a temporary token so it has not authenticated to a client principal // This token is passed to the authenticate readRemoteServiceTicketFromStream(in); }
public MD5Token(String authvalue, String hash_type) { this.hash_type = hash_type; this.auth_value = hash(authvalue); }
public void init() throws Exception { super.init(); if(auth_token == null) throw new IllegalStateException("no authentication mechanism configured"); if(auth_token instanceof X509Token) { X509Token tmp=(X509Token)auth_token; tmp.setCertificate(); } auth_token.init(); }
public boolean isInMembersList(IpAddress sender) { if(memberList == null || sender == null) return false; for(InetSocketAddress addr: memberList) { if(match(sender, addr)) return true; } return false; }
private void authenticateClientPrincipal() throws LoginException { subject = kerb5Utils.generateSecuritySubject(JASS_SECURITY_CONFIG,client_principal_name,client_password); }
private void generateServiceTicket() throws IOException { try { krbServiceTicket = Krb5TokenUtils.initiateSecurityContext(subject,service_principal_name); } catch(GSSException ge) { throw new IOException("Failed to generate serviceticket", ge); } }
private void writeServiceTicketToSream(DataOutput out) throws IOException { try { Krb5TokenUtils.encodeDataToStream(krbServiceTicket, out); } catch(IOException ioe) { throw ioe; } catch(Exception e) { throw new IOException(e); } }
private void readRemoteServiceTicketFromStream(DataInput in) throws IOException { try { remoteKrbServiceTicket = Krb5TokenUtils.decodeDataFromStream(in); } catch(IOException ioe) { throw ioe; } catch(Exception e) { throw new IOException(e); } } }
private void validateRemoteServiceTicket(Krb5Token remoteToken) throws Exception { byte[] remoteKrbServiceTicketLocal = remoteToken.remoteKrbServiceTicket; String clientPrincipalName = Krb5TokenUtils.validateSecurityContext(subject, remoteKrbServiceTicketLocal); if (!clientPrincipalName.equals(this.client_principal_name)) throw new Exception("Client Principal Names did not match"); }
public void init() throws Exception { super.init(); if(!match_ip_address && !match_logical_name) throw new IllegalArgumentException("either match_ip_address or match_logical_address has to be true"); if(match_string == null) throw new IllegalArgumentException("match_string cannot be null"); pattern=Pattern.compile(match_string); }
public void stop() { if(auth_token != null) auth_token.stop(); super.stop(); }
public void start() throws Exception { super.start(); if(auth_token != null) auth_token.start(); }
public void destroy() { if(auth_token != null) auth_token.destroy(); super.destroy(); }
public void init() { auth.register(this); registerBypasser(auth); }
@Property(name="auth_class",description="The fully qualified name of the class implementing the AuthToken interface") public void setAuthClass(String class_name) throws Exception { Object obj=Class.forName(class_name).newInstance(); auth_token=(AuthToken)obj; auth_token.setAuth(this); }
public Subject generateSecuritySubject(String jassLoginConfig, String username, String password) throws LoginException { LoginContext loginCtx = null; try { // "Client" references the JAAS configuration in the jaas.conf file. loginCtx = new LoginContext(jassLoginConfig, new Krb5TokenUtils.LoginCallbackHandler(username, password)); loginCtx.login(); log.debug(" : Krb5Token Kerberos login succeeded against user: %s", username); return loginCtx.getSubject(); } catch(LoginException e) { log.debug(" : Krb5Token Kerberos login failed against user: %s", username); throw e; } }
public void hashAndSetAuthValue(String authvalue) { this.auth_value = hash(authvalue); }
public MD5Token(String authvalue) { this.auth_value = hash(authvalue); }