Package org.apache.vysper.xmpp.authorization

Examples of org.apache.vysper.xmpp.authorization.SASLMechanism


        String requestedMechanism = stanza.getAttributeValue("mechanism");
        if (requestedMechanism == null) {
            return respondSASLFailure();
        }

        SASLMechanism identifiedMechanism = null;

        List<SASLMechanism> list = sessionContext.getServerRuntimeContext().getServerFeatures().getAuthenticationMethods();
        for (SASLMechanism saslMechanism : list) {
            if (saslMechanism.getName().equals(requestedMechanism)) {
                identifiedMechanism = saslMechanism;
                break;
            }
        }
        if (identifiedMechanism == null) throw new RuntimeException("return error");

        Stanza responseStanza = identifiedMechanism.started(sessionContext, sessionStateHolder, stanza);
        if (sessionStateHolder.getState() == SessionState.AUTHENTICATED) {
            AuthorizationRetriesCounter.removeFromSession(sessionContext);
        } else {
            AuthorizationRetriesCounter.getFromSession(sessionContext).countFailedTry();
        }
View Full Code Here


        String requestedMechanism = stanza.getAttributeValue("mechanism");
        if (requestedMechanism == null) {
            return respondSASLFailure();
        }

        SASLMechanism identifiedMechanism = null;

        List<SASLMechanism> list = sessionContext.getServerRuntimeContext().getServerFeatures()
                .getAuthenticationMethods();
        for (SASLMechanism saslMechanism : list) {
            if (saslMechanism.getName().equals(requestedMechanism)) {
                identifiedMechanism = saslMechanism;
                break;
            }
        }
        if (identifiedMechanism == null)
            throw new RuntimeException("return error");

        Stanza responseStanza = identifiedMechanism.started(sessionContext, sessionStateHolder, stanza);
        if (sessionStateHolder.getState() == SessionState.AUTHENTICATED) {
            AuthorizationRetriesCounter.removeFromSession(sessionContext);
        } else {
            AuthorizationRetriesCounter.getFromSession(sessionContext).countFailedTry();
        }
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.authorization.SASLMechanism

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.