Allow configuring a set of domains to allow logins from Persona.

[?]
Jan 9, 2014, 12:31 PM
HL6ZYWHFSOSTGCUEP2K554F5OY4RWAHJYS2MA2V3JMZIG262LFKAC

Dependencies

  • [2] QVIQAYZT Be paranoid about the Persona email address
  • [*] XJRJ4J7M Add user registration
  • [*] 36ZTCZ4F Add basic Persona support

Change contents

  • edit in src/lib/Hydra/Controller/User.pm at line 71
    [2.178]
    [5.738]
    # If persona_allowed_domains is set, check if the email address returned is on these domains.
    # When not configured, allow all domains.
    my $allowed_domains = $c->config->{persona_allowed_domains} || "";
    if ( $allowed_domains ne "") {
    my $email_ok = 0;
    my @domains = split ',', $allowed_domains;
    map { $_ =~ s/^\s*(.*?)\s*$/$1/ } @domains;
  • edit in src/lib/Hydra/Controller/User.pm at line 80
    [5.739]
    [5.739]
    foreach my $domain (@domains) {
    $email_ok = $email_ok || ((split '@', $email)[1] eq $domain);
    }
    die "Email address is not allowed to login." unless $email_ok;
    }