Search code examples
javaspringfreeradiustinyradius

How to fix tinyRadius bad packet: Invalid identifier exception?


I'm using TinyRadius library and a FreeRadius server for authentication in a Spring boot app. Authentication works fine for about 4 requests, then I start getting "Error occurred while authenticating user. Message: bad packet: invalid packet identifier (request: 5, response: 4") The request number matches the one I see in the FreeRadius server by the way.


Solution

  • I had the same problem and I had deployed some workaround. This kind of problem in my situation was very rare. In case of RadiusException I use close() method to close socket and I am creating new object of RadiusClient class, which has the same hostname and secret as old RadiusClient object. In other way I recreate Radius socket. Maybe it's not the best solution, but I didn't want to modify code of TinyRadius library.