RECT HTTPS
PerlSetVar PORT_REDIRECT SERVER_PORT
PerlSetVar RULES_URL http://app.tld/rules.json
...
</VirtualHost>
=head1 DESCRIPTION
Lemonldap::NG::SSOaaS::Apache::Client is an alterna
use Lemonldap::NG::Common::UserAgent;
use Lemonldap::NG::Common::Util qw(isHiddenAttr);
use JSON qw(from_json);
our $VERSION = '2.19.0';
our $_ua;
sub ua {
my ($class) = @_;
return $_ua if $
kMaintenanceMode($req);
}
sub _loadVhostConfig {
my ( $class, $req, $vhost ) = @_;
my ( $json, $rUrl, $rVhost );
if ( $class->tsv->{useSafeJail} ) {
if ( $req->env->{RULES_URL} ||
}
|| "http://127.0.0.1:" . $req->{env}->{SERVER_PORT} )
. '/rules.json';
$rVhost = $vhost;
}
$class->logger->debug("Try to retrieve rules f
package Lemonldap::NG::Handler::Lib::Status;
use strict;
use POSIX qw(setuid setgid);
use JSON qw(to_json);
use IO::Select;
use IO::Socket::INET;
use Lemonldap::NG::Handler::Lib::StatusConstants q
%$args = split( /[=&]/, $tmp ) if ($tmp);
&head($out) unless ( $args->{json} );
my ( $c, $m, $u );
foreach my $user ( keys %{ $status->{user
99 );
}
# JSON values
if ( $args->{json} ) {
$out->print(
to_json( { average => $m, total => $c } ) . "\nEN
----------------
##@method public PSGI-JSON-response newRSAKey($req)
# Return a hashref containing private and public keys
# The posted data must contain a JSON object containing
# {"password":"newpa
ssword"}
#
#@param $req Lemonldap::NG::Common::PSGI::Request object
#@return PSGI JSON response
sub newCertificate {
my ( $self, $req, @others ) = @_;
return $self->sendError( $req, 'There is
0 )
if (@others);
my $query = $req->jsonBodyToObj;
my $keys = $self->_generateX509( $query->{password}, "RSA" );
return $self->sendJSONresponse( $req, $keys );
}
sub newEcCertifica
nldap::NG::Manager::Conf::Parser;
# This module is called either to parse a new configuration in JSON format (as
# posted by the web interface) and test a new configuration object.
#
# The new object
e new configuration in JSON format
# or
# - newConf: the configuration to test
#
# The main method is check() which calls:
# - scanTree() if configuration is not parsed (JSON string)
# - testNewC
is stored in
# `message` property.
use strict;
use utf8;
use Crypt::URandom;
use Mouse;
use JSON 'to_json';
use Lemonldap::NG::Common::Conf::ReConstants;
use Lemonldap::NG::Manager::Attributes;
our
$self, $req ) = @_;
my $response_params;
my $mail_session_id;
# Get json infos
my $infos = $req->jsonBodyToObj
or return $self->p->sendError( $req, undef, 400 );
my $mail
$response_params->{msg} = "InitializePasswordReset: missing parameter";
return $self->sendJSONresponse( $req, $response_params, "code" => 400 );
}
unless ( "$secret" eq $self->initial
ams->{msg} =
"InitializePasswordReset: authentication error";
return $self->sendJSONresponse( $req, $response_params, "code" => 403 );
}
$self->logger->info(
"Initia
new user password, flag noJSONResponse
# Output: JSON response, including a code.
# code = 0 = success
# code > 0 = error
sub _checkHIBP {
my ( $self, $req, $pass, $noJSONResponse ) = @_;
my $
sage"} = "missing parameter password";
return $noJSONResponse
? $response_params
: $self->sendJSONresponse( $req, $response_params );
}
$passwo
mpromised $num times";
return $noJSONResponse
? $response_params
: $self->sendJSONresponse( $req, $response_params );
}
# by category
package Lemonldap::NG::Portal::Plugins::Status;
use strict;
use Mouse;
use JSON qw(from_json);
use MIME::Base64;
use IO::Socket::INET;
our $VERSION = '2.0.10';
extends 'Lemonldap::N
int("STATUS json=1$args\n");
while ( $_ = $out->getline ) {
last if (/^END$/);
$buf .= $_;
}
if ($buf) {
eval { $res = from_json( $buf, { al
1 } ) };
if ($@) {
$self->logger->error("JSON error: $@");
$self->logger->error("JSON: $buf");
}
foreach (qw(total average)) {
ldap::NG::Portal::Plugins::SingleSession;
use strict;
use Mouse;
use MIME::Base64;
use JSON qw(from_json to_json);
use Lemonldap::NG::Common::Session 'id2storage';
use Lemonldap::NG::Portal::Main::Co
user => $req->{sessionInfo}->{ $self->conf->{whatToTrace} },
sessions => to_json( \@otherSessionsId )
}
) if @otherSessionsId;
if ($singleUserByIPRuleMatched) {
tToken($token) ) {
# Read sessions from token
my $sessions = eval { from_json( $token->{sessions} ) };
if ($@) {
$self->logger->error("Bad encoding
process()
continues, else it returns the error code.
If it is an Ajax request, do() responds in JSON format else it manages
redirection if any. Else it calls
Lemonldap::NG::Portal::Main::Display::di
rtal::Plugins::MailPasswordReset;
use strict;
use Encode;
use Mouse;
use POSIX qw(strftime);
use JSON;
use Lemonldap::NG::Common::FormEncode;
use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
package Lemonldap::NG::Portal::UserDB::REST;
use strict;
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Portal::Main::Constants qw(
PE_OK
PE_ERROR
PE_USERNOTFOUND
PE_BADCREDENT
useMail} ? 'mail' : 'user' ) => $req->user,
'useMail' => ( $args{useMail} ? JSON::true : JSON::false ),
}
);
};
if ($@) {
$self->logger->error("Use
searchingAttributes => to_json($searching),
(
scalar @$excluding
? ( excludingAttributes => to_json($excluding) )
#
# All other ideas have to be set in Manager/Build/Attributes.pm !
# DON'T FORGET TO RUN 'make json' AFTER EACH CHANGE
package Lemonldap::NG::Manager::Build::CTrees;
our $VERSION = '2.22.0';
sub
'samlSPMetaDataMacros',
],
oidcOPMetaDataNode => [
'oidcOPMetaDataJSON',
'oidcOPMetaDataJWKS',
'oidcOPMetaDataExportedVars',
{
$VERSION = '2.21.0';
package Lemonldap::NG::Manager::Api;
use strict;
use utf8;
use Mouse;
use JSON;
use Lemonldap::NG::Common::Session;
use Lemonldap::NG::Common::Util qw/genId2F display2F filter
r( $req, $res->{msg}, $res->{code} )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse( $req, $res->{secondFactors} );
}
sub getSecondFactorsByType {
my ( $self, $req ) =
r( $req, $res->{msg}, $res->{code} )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse( $req, $res->{secondFactors} );
}
sub getSecondFactorsById {
my ( $self, $req ) = @_
h files, never in portal or handler chain
# for performances reasons
# DON'T FORGET TO RUN "make json" AFTER EACH CHANGE
package Lemonldap::NG::Manager::Build::Attributes;
our $VERSION = '2.22.0';
},
oidcRPMetaDataNode => {
test => sub { 1 }
},
oidcmetadatajson => {
test => sub { 1 }
},
oidcmetadatajwks => {
test => s
Options => { type => 'subContainer', },
# OpenID Connect providers
oidcOPMetaDataJSON => {
type => 'file',
keyTest => sub { 1 }
},
oidcOPMet
"ARRAY" );
return join( ' ', @{$optionValue} );
}
# Translate JSON booleans to integers
elsif ( JSON::is_bool($optionValue) ) {
return $optionValue ? 1 : 0;
}
else
#
# All other ideas have to be set in Manager/Build/Attributes.pm!
# DO NOT FORGET TO RUN "make json" AFTER EACH CHANGE
package Lemonldap::NG::Manager::Build::Tree;
our $VERSION = '2.22.0';
sub t
ortal and portal
# plugins, and displayed in the Handler Status page
# DON'T FORGET TO RUN "make json" AFTER EACH CHANGE
package Lemonldap::NG::Manager::Build::PortalConstants;
our $VERSION = '2.22
ssword;
use strict;
use Lemonldap::NG::Portal::Main::Constants 'PE_OK';
use Mouse;
use JSON qw(from_json to_json);
use Lemonldap::NG::Common::Crypto;
our $VERSION = '2.21.0';
extends 'Lemonldap::NG
::TOTP;
use strict;
use Lemonldap::NG::Portal::Main::Constants 'PE_OK';
use Mouse;
use JSON qw(from_json to_json);
our $VERSION = '2.21.0';
extends qw(
Lemonldap::NG::Portal::2F::Register::Base