Append ChoiceParam & ChoiceValue (#2600)

This commit is contained in:
Alexandre KARIM 2021-09-06 10:47:06 +02:00
parent eab4d4a31e
commit 6b85a85026
19 changed files with 63 additions and 15 deletions

View File

@ -29,17 +29,19 @@ and choose Proxy for authentication and users.
Then, go in ``Proxy parameters``:
- **Internal portal URL**: URL of internal portal
- **Session service URL** (optional): Session service URL (default:
same as previous for SOAP, same with "/session/my" for REST)
- **Cookie name** (optional): name of the cookie of internal portal, if
different from external portal
- **Authentication level**: authentication level for Proxy module
- **Use SOAP instead of REST**: use a deprecated SOAP server instead of
a REST one (you must set it if internal portal version is < 2.0). In
this case, "Portal URL" parameter must contain SOAP endpoint
(generally http://auth.example.com/index.pl/sessions for 1.9 and
earlier, http://auth.example.com/sessions for 2.0)
- **Internal portal URL**: URL of internal portal
- **Internal portal choice parameter** (optional): Choice parameter of the internal portal if applicable
- **Internal portal choice value** (optional): Value of the choice parameter of the internal portal
- **Session service URL** (optional): Session service URL (default:
same as previous for SOAP, same with "/session/my" for REST)
- **Cookie name** (optional): name of the cookie of internal portal, if
different from external portal
Internal portal
~~~~~~~~~~~~~~~
@ -59,6 +61,10 @@ in your lemonldap-ng.ini:
soapProxyUrn = urn:Lemonldap/NG/Common/CGI/SOAPService
.. note::
If the internal portal uses :doc:`Choice Authentication<authchoice>`, you must specify 'Internal portal choice parameter' and 'Internal portal choice value' depending on its configuration.
This feature needs at least LLNG version 2.0.14
.. attention::

View File

@ -51,7 +51,7 @@ our $authParameters = {
oidcParams => [qw(oidcAuthnLevel oidcRPCallbackGetParam oidcRPStateTimeout)],
openidParams => [qw(openIdAuthnLevel openIdExportedVars openIdSecret openIdIDPList)],
pamParams => [qw(pamAuthnLevel pamService)],
proxyParams => [qw(proxyAuthnLevel proxyAuthService proxySessionService remoteCookieName proxyUseSoap)],
proxyParams => [qw(proxyAuthnLevel proxyUseSoap proxyAuthService proxyAuthServiceChoiceParam proxyAuthServiceChoiceValue proxySessionService remoteCookieName)],
radiusParams => [qw(radiusAuthnLevel radiusSecret radiusServer)],
remoteParams => [qw(remotePortal remoteCookieName remoteGlobalStorage remoteGlobalStorageOptions)],
restParams => [qw(restAuthnLevel restAuthUrl restUserDBUrl restPwdConfirmUrl restPwdModifyUrl)],

View File

@ -2962,6 +2962,12 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
'proxyAuthService' => {
'type' => 'text'
},
'proxyAuthServiceChoiceParam' => {
'type' => 'text'
},
'proxyAuthServiceChoiceValue' => {
'type' => 'text'
},
'proxySessionService' => {
'type' => 'text'
},

View File

@ -3623,6 +3623,8 @@ m{^(?:ldapi://[^/]*/?|\w[\w\-\.]*(?::\d{1,5})?|ldap(?:s|\+tls)?://\w[\w\-\.]*(?:
# Proxy
proxyAuthService => { type => 'text', },
proxySessionService => { type => 'text', },
proxyAuthServiceChoiceParam => { type => 'text', },
proxyAuthServiceChoiceValue => { type => 'text', },
remoteCookieName => { type => 'text', },
proxyUseSoap => {
type => 'bool',

View File

@ -369,9 +369,9 @@ sub tree {
help => 'authproxy.html',
form => 'simpleInputContainer',
nodes => [
'proxyAuthnLevel', 'proxyAuthService',
'proxySessionService', 'remoteCookieName',
'proxyUseSoap'
'proxyAuthnLevel', 'proxyUseSoap', 'proxyAuthService',
'proxyAuthServiceChoiceParam', 'proxyAuthServiceChoiceValue',
'proxySessionService', 'remoteCookieName'
]
},
{

View File

@ -814,6 +814,8 @@
"previous":"السابق",
"privateKey":"مفتاح الخاصة",
"proxyAuthService":"يو آر إل البوابة الداخلي",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"مستوى إثبات الهوية",
"proxyParams":"معايير البروكسي",
"proxySessionService":"رابط اليورال لخدمة الجلسة",

View File

@ -814,6 +814,8 @@
"previous":"Previous",
"privateKey":"Private key",
"proxyAuthService":"Internal portal URL",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Authentication level",
"proxyParams":"Proxy parameters",
"proxySessionService":"Session service URL",

View File

@ -814,6 +814,8 @@
"previous":"Previous",
"privateKey":"Private key",
"proxyAuthService":"Internal portal URL",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Authentication level",
"proxyParams":"Proxy parameters",
"proxySessionService":"Session service URL",

View File

@ -814,6 +814,8 @@
"previous":"Previous",
"privateKey":"Clave privada",
"proxyAuthService":"URL de portal interno",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Nivel de autentificación",
"proxyParams":"Parámetros del proxy",
"proxySessionService":"Session service URL",

View File

@ -814,6 +814,8 @@
"previous":"Précédente",
"privateKey":"Clef privée",
"proxyAuthService":"URL du portail interne",
"proxyAuthServiceChoiceParam":"Paramètre choix du portail interne",
"proxyAuthServiceChoiceValue":"Valeur choix du portail interne",
"proxyAuthnLevel":"Niveau d'authentification",
"proxyParams":"Paramètres Proxy",
"proxySessionService":"URL du service de session",

View File

@ -814,6 +814,8 @@
"previous":"Precedente",
"privateKey":"Chiave privata",
"proxyAuthService":"URL del portale interno",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Livello di autenticazione",
"proxyParams":"Parametri Proxy",
"proxySessionService":"URL del servizio di sessione",

View File

@ -814,6 +814,8 @@
"previous":"Poprzedni",
"privateKey":"Prywatny klucz",
"proxyAuthService":"Wewnętrzny adres URL portalu",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Poziom uwierzytelnienia",
"proxyParams":"Parametry proxy",
"proxySessionService":"Adres URL usługi sesji",

View File

@ -814,6 +814,8 @@
"previous":"Önceki",
"privateKey":"Özel anahtar",
"proxyAuthService":"Dahili portal URL'si",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Doğrulama seviyesi",
"proxyParams":"Proxy parametreleri",
"proxySessionService":"Oturum servis URL'si",

View File

@ -814,6 +814,8 @@
"previous":"Trước",
"privateKey":"Khóa cá nhân",
"proxyAuthService":"URL cổng nội bộ",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"Mức xác thực",
"proxyParams":"Các tham số proxy",
"proxySessionService":"URL dịch vụ phiên",

View File

@ -814,6 +814,8 @@
"previous":"Previous",
"privateKey":"Private key",
"proxyAuthService":"Internal portal URL",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"认证等级",
"proxyParams":"Proxy parameters",
"proxySessionService":"Session service URL",

View File

@ -814,6 +814,8 @@
"previous":"前一個",
"privateKey":"私鑰",
"proxyAuthService":"內部首頁 URL",
"proxyAuthServiceChoiceParam":"Internal portal choice parameter",
"proxyAuthServiceChoiceValue":"Internal portal choice value",
"proxyAuthnLevel":"驗證等級",
"proxyParams":"代理伺服器參數",
"proxySessionService":"工作階段服務 URL",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -37,8 +37,20 @@ sub getUser {
return PE_OK if ( $req->data->{_proxyQueryDone} );
$self->logger->debug(
'Proxy push auth to ' . $self->conf->{proxyAuthService} );
my $resp = $self->ua->post( $self->conf->{proxyAuthService},
{ user => $req->{user}, password => $req->data->{password} } );
my $resp = $self->ua->post(
$self->conf->{proxyAuthService},
{
user => $req->{user},
password => $req->data->{password},
(
$self->conf->{proxyAuthServiceChoiceParam}
&& $self->conf->{proxyAuthServiceChoiceValue}
? ( $self->conf->{proxyAuthServiceChoiceParam} =>
$self->conf->{proxyAuthServiceChoiceValue} )
: ()
),
}
);
unless ( $resp->is_success ) {
$self->logger->error(
'Unable to query authentication service: ' . $resp->status_line );
@ -97,7 +109,7 @@ sub setSessionInfo {
$req->{sessionInfo}->{$_} ||= $res->{$_} unless (/^_/);
}
$req->data->{_setSessionInfoDone}++;
return PE_OK;
}
@ -113,7 +125,7 @@ sub authLogout {
]
);
my $resp = $self->ua->request($q);
return PE_OK;
}