post confirm to issuer url after restoring (#2142)
This commit is contained in:
parent
8afbd2214d
commit
755a5c3a6b
|
@ -76,6 +76,7 @@ sub display {
|
||||||
MSG => $req->info,
|
MSG => $req->info,
|
||||||
HIDDEN_INPUTS => $self->buildHiddenForm($req),
|
HIDDEN_INPUTS => $self->buildHiddenForm($req),
|
||||||
ACTIVE_TIMER => $req->data->{activeTimer},
|
ACTIVE_TIMER => $req->data->{activeTimer},
|
||||||
|
FORM_ACTION => $req->data->{confirmFormAction} || "#",
|
||||||
FORM_METHOD => $self->conf->{confirmFormMethod},
|
FORM_METHOD => $self->conf->{confirmFormMethod},
|
||||||
CHOICE_PARAM => $self->conf->{authChoiceParam},
|
CHOICE_PARAM => $self->conf->{authChoiceParam},
|
||||||
CHOICE_VALUE => $req->data->{_authChoice},
|
CHOICE_VALUE => $req->data->{_authChoice},
|
||||||
|
|
|
@ -12,6 +12,7 @@ use Mouse;
|
||||||
use MIME::Base64;
|
use MIME::Base64;
|
||||||
use IO::String;
|
use IO::String;
|
||||||
use URI::Escape;
|
use URI::Escape;
|
||||||
|
use URI;
|
||||||
use Lemonldap::NG::Common::FormEncode;
|
use Lemonldap::NG::Common::FormEncode;
|
||||||
use Lemonldap::NG::Portal::Main::Constants qw(
|
use Lemonldap::NG::Portal::Main::Constants qw(
|
||||||
PE_OK
|
PE_OK
|
||||||
|
@ -137,6 +138,10 @@ sub _forAuthUser {
|
||||||
$self->restoreRequest( $req, $r );
|
$self->restoreRequest( $req, $r );
|
||||||
@path = @{ $req->pdata->{ $self->ipath . 'Path' } }
|
@path = @{ $req->pdata->{ $self->ipath . 'Path' } }
|
||||||
if ( $req->pdata->{ $self->ipath . 'Path' } );
|
if ( $req->pdata->{ $self->ipath . 'Path' } );
|
||||||
|
|
||||||
|
# In case a confirm form is shown, we need it to POST on the
|
||||||
|
# current Path
|
||||||
|
$req->data->{confirmFormAction} = URI->new($req->uri)->path;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Clean pdata: keepPdata has been set, so pdata must be cleaned here
|
# Clean pdata: keepPdata has been set, so pdata must be cleaned here
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<div id="logincontent" class="container">
|
<div id="logincontent" class="container">
|
||||||
|
|
||||||
<form id="form" action="#" method="<TMPL_VAR NAME="FORM_METHOD">" class="confirm" role="form">
|
<form id="form" action="<TMPL_VAR NAME="FORM_ACTION">" method="<TMPL_VAR NAME="FORM_METHOD">" class="confirm" role="form">
|
||||||
|
|
||||||
<TMPL_VAR NAME="HIDDEN_INPUTS">
|
<TMPL_VAR NAME="HIDDEN_INPUTS">
|
||||||
<TMPL_IF NAME="AUTH_URL">
|
<TMPL_IF NAME="AUTH_URL">
|
||||||
|
|
|
@ -193,10 +193,14 @@ SKIP: {
|
||||||
),
|
),
|
||||||
'Follow internal redirection from SAML-SP to OIDC-OP'
|
'Follow internal redirection from SAML-SP to OIDC-OP'
|
||||||
);
|
);
|
||||||
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
|
||||||
|
$spPdata = expectCookie( $res, 'lemonldappdata' );
|
||||||
|
|
||||||
|
( $host, $tmp, $query ) =
|
||||||
|
expectForm( $res, undef, qr#^/oauth2/authorize#, 'confirm' );
|
||||||
ok(
|
ok(
|
||||||
$res = $sp->_get(
|
$res = $sp->_get(
|
||||||
$url,
|
'/oauth2/authorize',
|
||||||
query => $query,
|
query => $query,
|
||||||
accept => 'text/html',
|
accept => 'text/html',
|
||||||
cookie => "lemonldap=$spId;$spPdata"
|
cookie => "lemonldap=$spId;$spPdata"
|
||||||
|
|
|
@ -176,10 +176,14 @@ SKIP: {
|
||||||
),
|
),
|
||||||
'Follow internal redirection from SAML-SP to OIDC-OP'
|
'Follow internal redirection from SAML-SP to OIDC-OP'
|
||||||
);
|
);
|
||||||
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
|
||||||
|
( $host, $url, $query ) =
|
||||||
|
expectForm( $res, undef, qr#/oauth2/authorize#, 'confirm' );
|
||||||
|
$spPdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
|
||||||
|
|
||||||
ok(
|
ok(
|
||||||
$res = $sp->_get(
|
$res = $sp->_get(
|
||||||
$url,
|
'/oauth2/authorize',
|
||||||
query => $query,
|
query => $query,
|
||||||
accept => 'text/html',
|
accept => 'text/html',
|
||||||
cookie => "lemonldap=$spId;$spPdata"
|
cookie => "lemonldap=$spId;$spPdata"
|
||||||
|
|
|
@ -179,10 +179,13 @@ SKIP: {
|
||||||
),
|
),
|
||||||
'Follow internal redirection from SAML-SP to OIDC-OP'
|
'Follow internal redirection from SAML-SP to OIDC-OP'
|
||||||
);
|
);
|
||||||
( $host, $tmp, $query ) = expectForm( $res, '#', undef, 'confirm' );
|
|
||||||
|
$spPdata = 'lemonldappdata=' . expectCookie( $res, 'lemonldappdata' );
|
||||||
|
( $host, $tmp, $query ) =
|
||||||
|
expectForm( $res, undef, qr#^/oauth2/authorize#, 'confirm' );
|
||||||
ok(
|
ok(
|
||||||
$res = $sp->_get(
|
$res = $sp->_get(
|
||||||
$url,
|
'/oauth2/authorize',
|
||||||
query => $query,
|
query => $query,
|
||||||
accept => 'text/html',
|
accept => 'text/html',
|
||||||
cookie => "lemonldap=$spId;$spPdata"
|
cookie => "lemonldap=$spId;$spPdata"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user