Update User-Name AVP on Post Auth module

Alan DeKok aland at deployingradius.com
Fri Oct 20 16:02:36 UTC 2023

On Oct 20, 2023, at 11:49 AM, Suriya Shankar <suriya.dshankar at gmail.com> wrote:
> I am aware that It's not good to alter the User-Name  but I have a
> requirement.

  If the requirement is to modify the User-Name in the request, then the requirement is wrong.

  I can require that my bicycle go 200Kph, but that doesn't make it realistic.

> I am authenticating an EAP_TTLS request and during the
> Post-Auth section every module in the Unlang is being called by
> *modcall_recurse*, one such is the policy module where I update the
> User-Name along with other standard AVP in reply just to verify.

  You can edit the User-Name in the reply.  That doesn't affect anything.

> As soon as
> the control came back to the modcall.c *User-Name* value alone kept intact.
> Is there some sort of callback or method handle that reverts back the
> User-Name to its original.

  I don't think you need to change the User-Name.

  Any policy which needs a changed User-Name can be modified to use the Stripped-User-Name.  That's what the Stripped-User-Name is for.

  Alan DeKok.

More information about the Freeradius-Devel mailing list