Skip to content

Conversation

@anusplus
Copy link

Summary

accessRequest() currently overwrites Service-Type with Login-User when $state is null.
This makes it impossible for callers to set Service-Type explicitly (e.g., Authenticate-Only).

This change ensures the default Service-Type = Login-User is only applied when the caller has not already set the attribute.


Problem

  • When $state is null, accessRequest() always executes setAttribute(6, 1)
    (i.e. Service-Type = Login-User)
  • This overrides any caller-provided Service-Type (e.g. Authenticate-Only)
  • As a result, FreeRADIUS receives an incorrect value

Change

  • In accessRequest(), only set Service-Type = Login-User if Service-Type is not already present in the outgoing attributes

Behavior

Before

  • Caller sets Service-Type = Authenticate-Only
  • accessRequest() overwrites it with Login-User

After

  • Caller sets Service-Type = Authenticate-Only
  • accessRequest() preserves it

Files Changed

  • src/Radius.php

Testing

  • Verified against a production FreeRADIUS server
    Service-Type remains Authenticate-Only when explicitly set by caller

Notes

This keeps the default behavior unchanged for callers who don’t set Service-Type,
while unblocking explicit Service-Type use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant