Radius Server - IAS - Add attribute to response packet

This is Interesting: Free IT Magazines  
Home > Archive > Radius Server > May 2004 > IAS - Add attribute to response packet





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author IAS - Add attribute to response packet
Miroslav Dolecek

2004-05-31, 4:51 pm

Hi all,

I want to set VLAN on cisco switch according to membership in Organization
Unit(Active Directory) after user is authenticated by RADIUS server (IAS).
I tried to use RadiusExtensionProcess2 functions on win2k3, but
unsuccessfully. My DLL is made in Visual Studio 2003 and cooperation with
IAS looks good. I need to add IAS string attribute 81
(Tunnel-Pvt-Group-ID) to response packet that is sent to CISCO. If I add
static attribute manually on IAS, everything works fine(I see the value on
CISCO). But when I try to add attribute by IAS extension dll, nothing
appears in cisco debug console. In IAS has attribute 81 data type
octetstring - I don't know what type of string (8bit, 16bit..?) I need
assign to lpValue. I attach part of my test code. Could you write me
please, where I have mistake? Any help
would be greatly appreciated.

Thx Mira

---------------------------------------------------------------------------------
#define _WIN32_WINNT 0x0502 //Win 2K3

#include <windows.h>
#include <authif.h>
#include <string.h>

__declspec(dllexport) DWORD WINAPI RadiusExtensionProcess2(
PRADIUS_EXTENSION_CONTROL_BLOCK pECB
)
{
DWORD dwRet;
RADIUS_ATTRIBUTE raNewAtt;
PRADIUS_ATTRIBUTE_ARRAY pOutAttrs;
CHAR szOUName[5];

if (pECB->repPoint != repAuthentication)
{
return NO_ERROR;
}

if (pECB->rcResponseType == rcAccessReject)
{
return NO_ERROR;
}

pOutAttrs = pECB->GetResponse(pECB, rcAccessAccept);

strcpy (szOUName, "Test");

raNewAtt.dwAttrType=81;
raNewAtt.fDataType=rdtString;
raNewAtt.cbDataLength=sizeof(szOUName);
raNewAtt.lpValue = (const char *)szOUName;

dwRet = pOutAttrs->Add(pOutAttrs, &raNewAtt);

return dwRet;
}
---------------------------------------------------------------------------------
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com