File manager - Edit - /usr/local/cpanel/install/EnableWebProsExternalAuthn.pm
Back
#!/usr/local/cpanel/3rdparty/bin/perl # Copyright 2025 WebPros International, LLC # All rights reserved. # copyright@cpanel.net http://cpanel.net # This code is subject to the cPanel license. Unauthorized copying is prohibited. package Install::EnableWebProsExternalAuthn; use cPstrict; use parent qw( Cpanel::Task ); use Cpanel::Leika (); use Cpanel::Security::Authn::OpenIdConnect (); our $VERSION = '1.0'; =head1 DESCRIPTION This task configures the WebPros External Authentication provider and enables it for WHM on install or upgrade. =over 1 =item Type: cPanel setup =item Frequency: once =item EOL: never =back =cut exit __PACKAGE__->runtask() unless caller; sub new ($proto) { my $self = $proto->SUPER::new; $self->set_internal_name('enable_webpros_external_authn'); return $self; } sub perform ($self) { # Only mark this task done once it actually succeeds. The Leika config # that governs WebPros SSO visibility syncs to the system asynchronously # (via license check-in), so it may not be present yet the first time # this task runs; retry on each subsequent run rather than permanently # recording completion against incomplete information. Keep the # 'cpanel' prefix from the previous do_once() call so the success # marker stays at the path Cpanel::ImagePrep::Task::webprosid checks. $self->run_sub_once( version => '132-webpros-external-authn', prefix => 'cpanel', eol => 'never', code => sub { $self->enable_webpros_external_authn(); } ); return 1; } sub enable_webpros_external_authn ($self) { # Leika has not synced to this system yet, so we cannot yet tell # whether WebPros SSO should be enabled. Defer instead of guessing. return 0 if !Cpanel::Leika::config_valid(); my $provider = Cpanel::Security::Authn::OpenIdConnect::get_openid_provider( 'whostmgrd', 'webpros' ); if ( !$provider->is_configured() ) { $provider->set_client_configuration( {} ); } Cpanel::Security::Authn::OpenIdConnect::enable_openid_connect_provider( 'whostmgrd', 'webpros' ); return 1; } 1;
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings