private GuacamoleRadiusChallenge getRadiusChallenge(RadiusPacket challengePacket) {

        // Try to get the state attribute - if it's not there, we have a problem
        RadiusAttribute stateAttr = challengePacket.findAttribute(Attr_State.TYPE);
        if (stateAttr == null) {
            logger.error("Something went wrong, state attribute not present.");
            logger.debug("State Attribute turned up null, which shouldn't happen in AccessChallenge.");
            return null;
        }

        // We need to get the reply message so we know what to ask the user
        RadiusAttribute replyAttr = challengePacket.findAttribute(Attr_ReplyMessage.TYPE);
        if (replyAttr == null) {
            logger.error("No reply message received from the server.");
            logger.debug("Expecting a Attr_ReplyMessage attribute on this packet, and did not get one.");
            return null;
        }

        // We have the required attributes - convert to strings and then generate the additional login box/field
        String replyMsg = replyAttr.getValue().toString();
        String radiusState = BaseEncoding.base16().encode(stateAttr.getValue().getBytes());
        Field radiusResponseField = new PasswordField(CHALLENGE_RESPONSE_PARAM);
        Field radiusStateField = new RadiusStateField(radiusState);

        // Return the GuacamoleRadiusChallenge object that has the state
        // and the expected response.
        return new GuacamoleRadiusChallenge(replyMsg,
                new CredentialsInfo(Arrays.asList(radiusResponseField,
                        radiusStateField)));
    }
Returns an object containing the challenge message and the expected
credentials from a RADIUS challenge, or null if either state or reply
attributes are missing from the challenge.

@param challengePacket
    The AccessChallenge RadiusPacket received from the RADIUS 
    server.

@return
    A GuacamoleRadiusChallenge object that contains the challenge message
    sent by the RADIUS server and the expected credentials that should
    be requested of the user in order to continue authentication.  One
    of the expected credentials *must* be the RADIUS state.  If either
    state or the reply are missing from the challenge this method will
    return null.
extensions/guacamole-auth-radius/src/main/java/org/apache/guacamole/auth/radius/AuthenticationProviderService.java