Commit 7690a568 authored by Clément OUDOT's avatar Clément OUDOT

Put simple values in buil_urlencoded args (#1527)

parent ba426f67
......@@ -188,12 +188,14 @@ sub extractFormInfo {
$stateSession->update($stateInfos);
my $authn_uri = $self->linkedInAuthorizationEndpoint;
my $client_id = $self->conf->{linkedInClientID};
my $scope = $self->conf->{linkedInScope};
$authn_uri .= '?'
. build_urlencoded(
response_type => 'code',
client_id => $self->conf->{linkedInClientID},
client_id => $client_id,
redirect_uri => $callback_url,
scope => $self->conf->{linkedInScope},
scope => $scope,
state => $stateSession->id,
);
......
......@@ -148,12 +148,13 @@ sub extractFormInfo {
# Build the redirection
$self->logger->debug("OpenID redirection to $url");
my $req_url = $req->data->{_url};
my $check_url = $claimed_identity->check_url(
return_to => $self->conf->{portal}
. '?openid=1&'
. (
$req->data->{_url}
? build_urlencoded( url => $req->data->{_url} )
$req_url
? build_urlencoded( url => $req_url )
: ''
),
trust_root => $self->conf->{portal},
......
......@@ -897,23 +897,24 @@ sub extractFormInfo {
my $disco_url = $self->conf->{samlDiscoveryProtocolURL};
my $portal = $self->conf->{portal};
$disco_url .= ( $disco_url =~ /\?/ ? '&' : '?' )
. build_urlencoded(
entityID => $self->getMetaDataURL( 'samlEntityID', 0, 1 ),
return => $self->conf->{portal},
return => $portal,
returnIDParam => 'idp'
);
if ( defined $self->conf->{samlDiscoveryProtocolPolicy} ) {
$disco_url .= "&"
. build_urlencoded(
policy => $self->conf->{samlDiscoveryProtocolPolicy} );
my $dppolicy = $self->conf->{samlDiscoveryProtocolPolicy};
$disco_url .= "&" . build_urlencoded( policy => $dppolicy );
}
if ( defined $self->conf->{samlDiscoveryProtocolIsPassive} ) {
my $dpispassive = $self->conf->{samlDiscoveryProtocolIsPassive};
$disco_url .= "&"
. build_urlencoded(
isPassive => $self->conf->{samlDiscoveryProtocolIsPassive}
isPassive => $dpispassive
? "true"
: "false"
);
......
......@@ -1335,9 +1335,10 @@ sub logout {
->{oidcRPMetaDataOptionsUserIDAttr}
|| $self->conf->{whatToTrace};
my $user_id = $req->{sessionInfo}->{$user_id_attribute};
my $iss = $self->conf->{oidcServiceMetaDataIssuer};
$url .= ( $url =~ /\?/ ? '&' : '?' )
. build_urlencoded(
iss => $self->conf->{oidcServiceMetaDataIssuer},
iss => $iss,
sid => $user_id
);
}
......
......@@ -294,12 +294,14 @@ sub _reset {
return PE_MAILERROR unless ( $req->data->{mailAddress} );
# Build confirmation url
my $req_url = $req->data->{_url};
my $skin = $self->p->getSkin($req);
my $url =
$self->conf->{mailUrl} . '?'
. build_urlencoded(
mail_token => $req->{id},
skin => $self->p->getSkin($req),
( $req->data->{_url} ? ( url => $req->data->{_url} ) : () ),
skin => $skin,
( $req_url ? ( url => $req_url ) : () ),
);
# Build mail content
......
......@@ -287,12 +287,14 @@ sub _register {
}
# Build confirmation url
my $req_url = $req->data->{_url};
my $skin = $self->p->getSkin($req);
my $url =
$self->registerUrl . '?'
. build_urlencoded(
register_token => $req->{id},
skin => $self->p->getSkin($req),
( $req->data->{_url} ? ( url => $req->data->{_url} ) : () ),
skin => $skin,
( $req_url ? ( url => $req_url ) : () ),
);
# Build mail content
......@@ -375,10 +377,12 @@ sub _register {
# Build portal url
my $url = $self->conf->{portal};
$url =~ s#/*$##;
my $req_url = $req->data->{_url};
my $skin = $self->p->getSkin($req);
$url .= '/?'
. build_urlencoded(
skin => $self->p->getSkin($req),
( $req->data->{_url} ? ( url => $req->data->{_url} ) : () ),
skin => $skin,
( $req_url ? ( url => $req_url ) : () ),
);
# Replace variables in body
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment