Class AuthToken

    • Constructor Detail

      • AuthToken

        @Deprecated
        public AuthToken​(String jid)
        Deprecated.
        Constucts a new AuthToken with the specified username. The username can be either a simple username or a full JID.
        Parameters:
        jid - the username or bare JID to create an authToken token with.
      • AuthToken

        @Deprecated
        public AuthToken​(String jid,
                         Boolean anonymous)
        Deprecated.
        Constucts a new AuthToken with the specified username. The username can be either a simple username or a full JID.
        Parameters:
        jid - the username or bare JID to create an authToken token with.
        anonymous - {code true} to generate an anonymous login, otherwise false
    • Method Detail

      • generateUserToken

        public static AuthToken generateUserToken​(String username)
        Constructs a new AuthToken that represents an authenticated user identified by the provider username.
        Parameters:
        username - the username to create an authToken token with.
        Returns:
        the auth token for the user
      • generateAnonymousToken

        public static AuthToken generateAnonymousToken()
        Constructs a new AuthToken that represents an authenticated, but anonymous user.
        Returns:
        an anonymouse auth token
      • generateOneTimeToken

        public static AuthToken generateOneTimeToken​(String token)
        Constructs a new OneTimeAuthToken that represents an one time recovery user.
        Parameters:
        token - the one time token.
        Returns:
        the newly generated auth token
      • getUsername

        public String getUsername()
        Returns the username associated with this AuthToken. A null value means that the authenticated user is anonymous.
        Returns:
        the username associated with this AuthToken or null when using an anonymous user.
      • getDomain

        @Deprecated
        public String getDomain()
        Deprecated.
        As Openfire serves only one domain, there's no need for a domain-specific token. Use XMPPServerInfo.getXMPPDomain() instead.
        Returns the domain associated with this AuthToken.
        Returns:
        the domain associated with this AuthToken.
      • isAnonymous

        public boolean isAnonymous()
        Returns true if this AuthToken is the Anonymous auth token.
        Returns:
        true if this token is the anonymous AuthToken.