dataset/seed/lemonldap/templates/interne_well_known.pl
2022-07-01 22:10:33 +02:00

16 lines
493 B
Perl

%echo "#!/usr/bin/env perl"
use HTTP::Tiny;
use JSON qw(from_json to_json);
my $baseUrl = 'https://%%domain_name_eth0/';
my $response = HTTP::Tiny->new->get('http://localhost/.well-known/openid-configuration');
die "Failed!\n" unless $response->{success};
my $json = from_json($response->{content});
$json->{token_endpoint} = $baseUrl . 'oauth2/token';
$json->{userinfo_endpoint} = $baseUrl . 'oauth2/userinfo';
$json->{jwks_uri} = $baseUrl . 'oauth2/jwks';
printf to_json($json) . "\n";