From aea940217557855ae6ebf92701ecaf6fec974228 Mon Sep 17 00:00:00 2001 From: gkdre234 <71565850+gkdre234@users.noreply.github.com> Date: Mon, 12 Apr 2021 15:35:38 +0200 Subject: [PATCH 1/2] better logging --- privacyidea_radius.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/privacyidea_radius.pm b/privacyidea_radius.pm index 2ce9a78..ec4f885 100644 --- a/privacyidea_radius.pm +++ b/privacyidea_radius.pm @@ -330,7 +330,7 @@ sub mapResponse { if ($value =~ /$regex/) { my $result = $1; $radReply{$radiusAttribute} = add_reply_attibute($radReply{$radiusAttribute}, "$prefix$result$suffix"); - &radiusd::radlog(Info, "++++++++ Result: Add RADIUS attribute $radiusAttribute = $result"); + &radiusd::radlog(Info, "++++++++ Result: Add RADIUS attribute $radiusAttribute = $prefix$result$suffix"); } else { &radiusd::radlog(Info, "++++++++ Result: No match, no RADIUS attribute $radiusAttribute added."); } @@ -500,7 +500,7 @@ sub authenticate { my $message = $decoded->{detail}{message}; if ( $decoded->{result}{value} ) { &radiusd::radlog( Info, "privacyIDEA access granted" ); - $RAD_REPLY{'Reply-Message'} = "privacyIDEA access granted"; + $RAD_REPLY{'Reply-Message'} = "privacyIDEA access granted for $params{'user'} realm='$params{'realm'}'"; # Add the response hash to the Radius Reply %RAD_REPLY = ( %RAD_REPLY, mapResponse($decoded)); $g_return = RLM_MODULE_OK; @@ -521,7 +521,7 @@ sub authenticate { %RAD_REPLY = ( %RAD_REPLY, mapResponse($decoded)); $g_return = RLM_MODULE_HANDLED; } else { - &radiusd::radlog( Info, "privacyIDEA access denied" ); + &radiusd::radlog( Info, "privacyIDEA access denied for $params{'user'} realm='$params{'realm'}'" ); #$RAD_REPLY{'Reply-Message'} = "privacyIDEA access denied"; $g_return = RLM_MODULE_REJECT; } From fdaf45ec12c93767958d7712768c3f7fdfa1976e Mon Sep 17 00:00:00 2001 From: gkdre234 <71565850+gkdre234@users.noreply.github.com> Date: Wed, 21 Jul 2021 19:20:32 +0200 Subject: [PATCH 2/2] Update privacyidea_radius.pm Fehler gewesen... --- privacyidea_radius.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/privacyidea_radius.pm b/privacyidea_radius.pm index ec4f885..8091ce6 100644 --- a/privacyidea_radius.pm +++ b/privacyidea_radius.pm @@ -499,8 +499,8 @@ sub authenticate { my $decoded = $coder->decode($content); my $message = $decoded->{detail}{message}; if ( $decoded->{result}{value} ) { - &radiusd::radlog( Info, "privacyIDEA access granted" ); - $RAD_REPLY{'Reply-Message'} = "privacyIDEA access granted for $params{'user'} realm='$params{'realm'}'"; + &radiusd::radlog( Info, "privacyIDEA access granted for $params{'user'} realm='$params{'realm'}'" ); + $RAD_REPLY{'Reply-Message'} = "privacyIDEA access granted"; # Add the response hash to the Radius Reply %RAD_REPLY = ( %RAD_REPLY, mapResponse($decoded)); $g_return = RLM_MODULE_OK;