Skip to content

EAP-MSCHAP v2 Issues With FreeRadius? #13

@blakekrone

Description

@blakekrone

Trying to use the code to integrate a simple radius tester into an app and when I try to hit my freeradius server with mschapv2 test I get the following returned:

Access-Request failed with error 102 (EAP type is not EAP_MS_AUTH in access response).

If I use any other radius tester it works just fine.

        $client = new Radius();

        // set server, secret, and basic attributes
        $client->setServer( $config->auth_server_ip ) // RADIUS server address
               ->setAuthenticationPort( $config->auth_server_port )
               ->setSecret( $config->shared_secret )
               ->setTimeout( 30
               ->setDebug(true);

        // EAP-MSCHAP v2 authentication
        $authenticated = $client->accessRequestEapMsChapV2('radtest', '!radtest!');

        if ($authenticated === false) {
            // false returned on failure
            echo sprintf(
                "Access-Request failed with error %d (%s).\n",
                $client->getErrorCode(),
                $client->getErrorMessage()
            );
        } else {
            // access request was accepted - client authenticated successfully
            echo "Success!  Received Access-Accept response from RADIUS server.\n";
            $attributes = getReceivedAttributes();
            dd($attributes);
        }
2020-06-15 04:04:46 DEBUG: Added Attribute 1 (User-Name), format S, value radtest
2020-06-15 04:04:46 DEBUG: Added Attribute 79 (EAP-Message), format S, value ���radtest
2020-06-15 04:04:46 DEBUG: Added Attribute 80 (Message-Authenticator), format S, value 
2020-06-15 04:04:46 DEBUG: Added Attribute 6 (Service-Type), format I, value 1
2020-06-15 04:04:46 DEBUG: Packet type 1 (Access-Request) sent to 192.168.10.29
2020-06-15 04:04:46 DEBUG: Attribute 1 (User-Name), length (7), format S, value radtest
2020-06-15 04:04:46 DEBUG: Attribute 79 (EAP-Message), length (12), format S, value ���radtest
2020-06-15 04:04:46 DEBUG: Attribute 80 (Message-Authenticator), length (16), format S, value 
2020-06-15 04:04:46 DEBUG: Attribute 6 (Service-Type), length (4), format I, value 1
2020-06-15 04:04:46 DEBUG: Packet type 11 (Access-Challenge) received
2020-06-15 04:04:46 DEBUG: Attribute 79 (EAP-Message), length 6, format S, value ���� 
2020-06-15 04:04:46 DEBUG: Attribute 80 (Message-Authenticator), length 16, format S, value �%��y0�?O*�X�k/w
2020-06-15 04:04:46 DEBUG: Attribute 24 (State), length 16, format S, value ��B��*[�����0�Ez
Access-Request failed with error 102 (EAP type is not EAP_MS_AUTH in access response).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions