if(this.serverSideToken.authenticate(authHeader.getToken())){
if(this.serverSideToken.authenticate(authHeader.getToken(), msg)){
    public void up(Event evt) {        GMS.GmsHeader hdr = isJoinMessage(evt);        if((hdr != null) && (hdr.getType() == GMS.GmsHeader.JOIN_REQ)){            if(log.isDebugEnabled()){                log.debug("AUTH got up event");            }            //we found a join message - now try and get the AUTH Header            Message msg = (Message)evt.getArg();            if((msg.getHeader(AUTH.NAME) != null) && (msg.getHeader(AUTH.NAME) instanceof AuthHeader)){                AuthHeader authHeader = (AuthHeader)msg.getHeader(AUTH.NAME);                if(authHeader != null){                    //Now we have the AUTH Header we need to validate it                    if(this.serverSideToken.authenticate(authHeader.getToken())){                        //valid token                        if(log.isDebugEnabled()){                            log.debug("AUTH passing up event");                        }                        passUp(evt);                    }else{                        //invalid token                        if(log.isWarnEnabled()){                            log.warn("AUTH failed to validate AuthHeader token");                        }                        passDown(createFailureEvent(msg.getSrc(), "Authentication failed"));                    }                }else{                    //Invalid AUTH Header - need to send failure message                    if(log.isWarnEnabled()){                        log.warn("AUTH failed to get valid AuthHeader from Message");                    }                    passDown(createFailureEvent(msg.getSrc(), "Failed to find valid AuthHeader in Message"));                }            }else{                if(log.isDebugEnabled()){                    log.debug("No AUTH Header Found");                }                //should be a failure                passDown(createFailureEvent(msg.getSrc(), "Failed to find an AuthHeader in Message"));            }        }else{            //if debug            if(log.isDebugEnabled()){                log.debug("Message not a JOIN_REQ - ignoring it");            }            passUp(evt);        }    }