public void setAnonymousAuth() {
        // Anonymous users have a full JID. Use the random resource as the JID's node
        String resource = getAddress().getResource();
        setAddress(new JID(resource, getServerName(), resource, true));
        setStatus(Session.Status.AUTHENTICATED);
        authToken = AuthToken.generateAnonymousToken();
        // Add session to the session manager. The session will be added to the routing table as well
        sessionManager.addSession(this);
    }
Initialize the session as an anonymous login. This automatically upgrades the session's
status to authenticated and enables many features that are not available until
authenticated (obtaining managers for example).
xmppserver/src/main/java/org/jivesoftware/openfire/session/LocalClientSession.java