Skip to content
Snippets Groups Projects
Commit 82e6ed02 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

use user name, instead of IP address, to identify challenge requester

parent d6b8b7a6
No related branches found
No related tags found
No related merge requests found
......@@ -486,9 +486,14 @@ sub req_complete_challenge {
PRE_CHOMP => CHOMP_ONE,
INCLUDE_PATH => $templates_dir
});
my $source_ip = $ENV{HTTP_X_FORWARDED_FOR} ?
(split(/, /, $ENV{HTTP_X_FORWARDED_FOR}))[0] :
$ENV{REMOTE_ADDR};
my $user =
$ENV{'HTTP_DISPLAYNAME'} ? $ENV{'HTTP_DISPLAYNAME'} :
$ENV{'displayName'} ? $ENV{'displayName'} :
undef;
my $idp =
$ENV{'HTTP_SHIB_IDENTITY_PROVIDER'} ? $ENV{'HTTP_SHIB_IDENTITY_PROVIDER'} :
$ENV{'Shib-Identity-Provider'} ? $ENV{'Shib-Identity-Provider'} :
undef;
my $data = {
app => {
url => $self->{configuration}->{app}->{url},
......@@ -496,9 +501,10 @@ sub req_complete_challenge {
version => $self->{configuration}->{app}->{version},
name => $self->{configuration}->{app}->{name},
},
sourceip => $source_ip,
user => $user,
idp => $idp,
sp => $entityid,
to => $email,
entityid => $entityid,
token => $token->secret(),
challenge_url => sprintf(
'%s?action=complete_challenge&entityid=%s&email=%s',
......
......@@ -180,8 +180,8 @@ msgstr "Sélectionnez votre service"
#. (sourceip, entityid)
#: templates/mail/send_authentication_token.tt2.html:3 templates/mail/send_authentication_token.tt2.txt:2
msgid "Somebody with IP address %1 has requested to create test accounts for Service Provider with entityID %2."
msgstr "Quelqu'un avec l'adresse IP %1 a demandé la création de comptes de test pour le service %2."
msgid "User %1, authenticated by Identity Provider %2, has requested creation of test accounts for Service Provider %3."
msgstr "L'utilisateur %1, authentifié par le fournisseur d'identité %2, a demandé la création de comptes de test pour le fournisseur de service %3."
#: templates/web/edugain/create_accounts.tt2.html:8 templates/web/renater/create_accounts.tt2.html:10
msgid "Test accounts created"
......
<p>
[% lh.maketext("This is an email challenge automatically sent to you by [_1].", app.name) %]
[% lh.maketext("Somebody with IP address [_1] has requested to create test accounts for Service Provider with entityID [_2].", sourceip, entityid) %]
[% lh.maketext("This is an email challenge automatically sent to you by [_1].", app.name) %]
[% lh.maketext("User [_1], authenticated by Identity Provider [_2], has requested creation of test accounts for Service Provider [_3].", user, idp, sp) %]
[% lh.maketext("The address [_1] is mentioned in the federation metadata as a contact for this Service Provider.", to) %]
</p>
......
[% lh.maketext("This is an email challenge automatically sent to you by [_1].", app.name) %]
[% lh.maketext("Somebody with IP address [_1] has requested to create test accounts for Service Provider with entityID [_2].", sourceip, entityid) %]
[% lh.maketext("User [_1], authenticated by Identity Provider [_2], has requested creation of test accounts for Service Provider [_3].", user, idp, sp) %]
[% lh.maketext("The address [_1] is mentioned in the federation metadata as a contact for this Service Provider.", to) %]
[% lh.maketext("To complete the creation of test accounts, paste the following validation token in [_1]:", app.name) %]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment