__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

root@216.73.217.122: ~ $
<?php

namespace Packback\Lti1p3;

use Packback\Lti1p3\Helpers\Helpers;
use Packback\Lti1p3\Interfaces\ICache;
use Packback\Lti1p3\Interfaces\ICookie;
use Packback\Lti1p3\Interfaces\IDatabase;
use Packback\Lti1p3\Interfaces\ILtiRegistration;

class LtiOidcLogin
{
    public const COOKIE_PREFIX = 'lti1p3_';
    public const ERROR_MSG_LAUNCH_URL = 'No launch URL configured';
    public const ERROR_MSG_ISSUER = 'Could not find issuer';
    public const ERROR_MSG_LOGIN_HINT = 'Could not find login hint';

    public function __construct(
        public IDatabase $db,
        public ICache $cache,
        public ICookie $cookie
    ) {
    }

    /**
     * Static function to allow for method chaining without having to assign to a variable first.
     */
    public static function new(IDatabase $db, ICache $cache, ICookie $cookie): self
    {
        return new LtiOidcLogin($db, $cache, $cookie);
    }

    /**
     * Calculate the redirect location to return to based on an OIDC third party initiated login request.
     */
    public function getRedirectUrl(string $launchUrl, array $request): string
    {
        // Validate request data.
        $registration = $this->validateOidcLogin($request);

        // Build OIDC Auth response.
        $authParams = $this->getAuthParams($launchUrl, $registration->getClientId(), $request);

        return Helpers::buildUrlWithQueryParams($registration->getAuthLoginUrl(), $authParams);
    }

    public function validateOidcLogin(array $request): ILtiRegistration
    {
        if (!isset($request['iss'])) {
            throw new OidcException(static::ERROR_MSG_ISSUER);
        }

        if (!isset($request['login_hint'])) {
            throw new OidcException(static::ERROR_MSG_LOGIN_HINT);
        }

        // Fetch registration
        $clientId = $request['client_id'] ?? null;
        $registration = $this->db->findRegistrationByIssuer($request['iss'], $clientId);

        if (!isset($registration)) {
            $errorMsg = LtiMessageLaunch::getMissingRegistrationErrorMsg($request['iss'], $clientId);

            throw new OidcException($errorMsg);
        }

        return $registration;
    }

    public function getAuthParams(string $launchUrl, string $clientId, array $request): array
    {
        // Set cookie (short lived)
        $state = static::secureRandomString('state-');
        $this->cookie->setCookie(static::COOKIE_PREFIX.$state, $state, 60);

        $nonce = static::secureRandomString('nonce-');
        $this->cache->cacheNonce($nonce, $state);

        $authParams = [
            'scope' => 'openid', // OIDC Scope.
            'response_type' => 'id_token', // OIDC response is always an id token.
            'response_mode' => 'form_post', // OIDC response is always a form post.
            'prompt' => 'none', // Don't prompt user on redirect.
            'client_id' => $clientId, // Registered client id.
            'redirect_uri' => $launchUrl, // URL to return to after login.
            'state' => $state, // State to identify browser session.
            'nonce' => $nonce, // Prevent replay attacks.
            'login_hint' => $request['login_hint'], // Login hint to identify platform session.
        ];

        if (isset($request['lti_message_hint'])) {
            // LTI message hint to identify LTI context within the platform.
            $authParams['lti_message_hint'] = $request['lti_message_hint'];
        }

        return $authParams;
    }

    public static function secureRandomString(string $prefix = ''): string
    {
        return $prefix.hash('sha256', random_bytes(64));
    }
}

Filemanager

Name Type Size Permission Actions
Concerns Folder 0755
DeepLinkResources Folder 0755
Helpers Folder 0755
Interfaces Folder 0755
MessageValidators Folder 0755
JwksEndpoint.php File 1.42 KB 0644
Lti1p1Key.php File 1.44 KB 0644
LtiAbstractService.php File 1.37 KB 0644
LtiAssignmentsGradesService.php File 6.73 KB 0644
LtiConstants.php File 7.77 KB 0644
LtiCourseGroupsService.php File 2 KB 0644
LtiDeepLink.php File 1.44 KB 0644
LtiDeployment.php File 556 B 0644
LtiException.php File 92 B 0644
LtiGrade.php File 4.01 KB 0644
LtiGradeSubmissionReview.php File 1.75 KB 0644
LtiLineitem.php File 3.46 KB 0644
LtiMessageLaunch.php File 17.85 KB 0644
LtiNamesRolesProvisioningService.php File 976 B 0644
LtiOidcLogin.php File 3.54 KB 0644
LtiRegistration.php File 2.88 KB 0644
LtiServiceConnector.php File 7.59 KB 0644
OidcException.php File 93 B 0644
ServiceRequest.php File 4.53 KB 0644
Filemanager