Skip to content

Commit

Permalink
[req-changes] Docs and comment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Oct 26, 2023
1 parent bca0224 commit 7940faf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion docs/source/user/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,6 @@ then edit a specific organization and scroll down to
if all the organization use the same configuration, we recommend
changing the global setting.


``OPENWISP_RADIUS_NEEDS_IDENTITY_VERIFICATION``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
16 changes: 8 additions & 8 deletions openwisp_radius/api/freeradius_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,13 +178,14 @@ def authenticate(self, request):
username, request
)
if username is None and request is None:
# When using MAC roaming, the "username" attribute contains the
# MAC address (calling_station_id). If there's no open-session
# for the given MAC address, then don't authenticate the user.
#
# NOTE: We return "None" here instead of raising "AuthenticationFailed"
# to prevent unnecessary authentication rejected errors in freeradius
# logs.
# When using MAC auth roaming, the "username" attribute contains the MAC
# address (calling_station_id). When the user connects the first time,
# since it doesn't have any open session, the mac address authorization
# will fail, in order to avoid filling the log with failed mac address
# authorization requests we return "None" here
# (instead of raising "AuthenticationFailed").
# freeradius will take care of rejecting the authorization if no
# explicit "Auth-Type: Accept" is returned
return
return self._radius_token_authenticate(username, request)
if not uuid or not token:
Expand Down Expand Up @@ -261,7 +262,6 @@ def post(self, request, *args, **kwargs):
serializer.is_valid(raise_exception=True)
username = serializer.validated_data.get('username')
password = serializer.validated_data.get('password')

user = self.get_user(request, username, password)
if user and self.authenticate_user(request, user, password):
data, status = self.get_replies(user, organization_id=request.auth)
Expand Down

0 comments on commit 7940faf

Please sign in to comment.