Package org.sdnplatform.sync.thrift

Examples of org.sdnplatform.sync.thrift.AuthChallengeResponse


                channelState = ChannelState.AUTHENTICATED;
                m.setAuthScheme(org.sdnplatform.sync.thrift.
                                AuthScheme.NO_AUTH);
                break;
            case CHALLENGE_RESPONSE:
                AuthChallengeResponse cr = new AuthChallengeResponse();
                cr.setChallenge(generateChallenge());
                m.setAuthScheme(org.sdnplatform.sync.thrift.
                                AuthScheme.CHALLENGE_RESPONSE);
                m.setAuthChallengeResponse(cr);
                break;
        }
View Full Code Here


    }
   
    protected void handshakeChallengeResponse(HelloMessage request,
                                              Channel channel)
                                                      throws AuthException {
        AuthChallengeResponse cr = request.getAuthChallengeResponse();
        if (cr == null) {
            throw new AuthException("No authentication data in " +
                    "handshake message");
        }
        if (cr.isSetResponse()) {
            authenticateResponse(currentChallenge, cr.getResponse());
            currentChallenge = null;
            channelState = ChannelState.AUTHENTICATED;
            handleHello(request, channel);
        } else if (cr.isSetChallenge()) {
            HelloMessage m = new HelloMessage();
            if (getLocalNodeId() != null)
                m.setNodeId(getLocalNodeId());
            AsyncMessageHeader header = new AsyncMessageHeader();
            header.setTransactionId(getTransactionId());
            m.setHeader(header);
            SyncMessage bsm = new SyncMessage(MessageType.HELLO);
            bsm.setHello(m);

            AuthChallengeResponse reply = new AuthChallengeResponse();
            reply.setResponse(generateResponse(cr.getChallenge()));
            m.setAuthChallengeResponse(reply);
            channel.write(bsm);
        } else {
            throw new AuthException("No authentication data in " +
                    "handshake message");
View Full Code Here

TOP

Related Classes of org.sdnplatform.sync.thrift.AuthChallengeResponse

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.