RadAuthenticate Function

Action

Attempts to authenticate the RADIUS server by transmitting a list of attributes (previously set using RadSetAttribute...() functions) to the server and retrieving a list of attributes from the server. Returned attributes are accessed using RadGetAttribute...() functions.

Include file

radius.bdh

Syntax

RadAuthenticate( in sType  : string,
                 in sLogin : string,
                 in sPass  : string ): number;

Return value

  • RAD_AccessAccept if authentication is successful

  • RAD_AccessReject if authentication fails

Parameter Description
sType

Authentication type. Valid options include:

  • RAD_AUTH_PAP

  • RAD_AUTH_CHAP

  • RAD_AUTH_MSCHAP

  • RAD_AUTH_MSCHAP2

  • RAD_AUTH_EAPMD5

sLogin Login name.
sPass Pass phrase valid for the login name.

Example

dcltrans
  transaction TRun
  var
    nCode : number;
  begin
    RadSetAttributeNumber(RAD_NasPort, 1234);
    RadSetAttributeString(RAD_CallingStationId, "+1 1234 123 1234");
    nCode := RadAuthenticate(RAD_AUTH_MSCHAP2, "user", "pass");
    if nCode = RAD_AccessAccept then
      Print("Authentication successful");
      Print("Service Type = " + string(RadGetAttributeNumber(RAD_ServiceType)));
      Print("Framed_Protocol = " +string(RadGetAttributeNumber(RAD_FramedProtocol)));
      Print("Login_IP_Host = " + RadGetAttributeString(RAD_LoginIpHost));
      Print("Login_TCP_Port = " +string(RadGetAttributeNumber(RAD_LoginTcpPort)));
      Print("Reply_Message = " + RadGetAttributeString(RAD_ReplyMessage));
    else
      Print("Authentication failed");
    end;
  end TRun;