src/includes/classes/Core/Utils/OAuthServer.php
protected function authorizationServer(): AuthorizationServer
    {
        if ($this->AuthorizationServer) {
            return $this->AuthorizationServer;
        }
        $_one_month  = new \DateInterval('P1M');
        $_one_day    = new \DateInterval('P1D');
        $_10_minutes = new \DateInterval('PT10M');

        $AuthCodeRepository     = $this->App->Di->get(AuthCodeRepository::class);
        $ClientRepository       = $this->App->Di->get(ClientRepository::class);
        $RefreshTokenRepository = $this->App->Di->get(RefreshTokenRepository::class);
        $ScopeRepository        = $this->App->Di->get(ScopeRepository::class);
        $UserRepository         = $this->App->Di->get(UserRepository::class);

        $this->AuthorizationServer = new AuthorizationServer(
            $ClientRepository,
            $this->accessTokenRepository(),
            $ScopeRepository,
            $this->App->Config->©oauth['©private_key'],
            $this->App->Config->©oauth['©encryption_key']
        );
        $AuthCodeGrant          = new AuthCodeGrant($AuthCodeRepository, $RefreshTokenRepository, $_10_minutes);
        $PasswordGrant          = new PasswordGrant($UserRepository, $RefreshTokenRepository);
        $RefreshTokenGrant      = new RefreshTokenGrant($RefreshTokenRepository);
        $ClientCredentialsGrant = new ClientCredentialsGrant();
        $ImplicitGrant          = new ImplicitGrant($_one_day);

        $AuthCodeGrant->setRefreshTokenTTL($_one_month);
        $PasswordGrant->setRefreshTokenTTL($_one_month);
        $RefreshTokenGrant->setRefreshTokenTTL($_one_month);

        $this->AuthorizationServer->enableGrantType($AuthCodeGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($PasswordGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($RefreshTokenGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($ClientCredentialsGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($ImplicitGrant, $_one_day);

        return $this->AuthorizationServer;
    }
protected function authorizationServer(): AuthorizationServer
    {
        if ($this->AuthorizationServer) {
            return $this->AuthorizationServer;
        }
        $_one_month  = new \DateInterval('P1M');
        $_one_day    = new \DateInterval('P1D');
        $_10_minutes = new \DateInterval('PT10M');

        $AuthCodeRepository     = $this->App->Di->get(AuthCodeRepository::class);
        $ClientRepository       = $this->App->Di->get(ClientRepository::class);
        $RefreshTokenRepository = $this->App->Di->get(RefreshTokenRepository::class);
        $ScopeRepository        = $this->App->Di->get(ScopeRepository::class);
        $UserRepository         = $this->App->Di->get(UserRepository::class);

        $this->AuthorizationServer = new AuthorizationServer(
            $ClientRepository,
            $this->accessTokenRepository(),
            $ScopeRepository,
            $this->App->Config->©oauth['©private_key'],
            $this->App->Config->©oauth['©encryption_key']
        );
        $AuthCodeGrant          = new AuthCodeGrant($AuthCodeRepository, $RefreshTokenRepository, $_10_minutes);
        $PasswordGrant          = new PasswordGrant($UserRepository, $RefreshTokenRepository);
        $RefreshTokenGrant      = new RefreshTokenGrant($RefreshTokenRepository);
        $ClientCredentialsGrant = new ClientCredentialsGrant();
        $ImplicitGrant          = new ImplicitGrant($_one_day);

        $AuthCodeGrant->setRefreshTokenTTL($_one_month);
        $PasswordGrant->setRefreshTokenTTL($_one_month);
        $RefreshTokenGrant->setRefreshTokenTTL($_one_month);

        $this->AuthorizationServer->enableGrantType($AuthCodeGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($PasswordGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($RefreshTokenGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($ClientCredentialsGrant, $_one_day);
        $this->AuthorizationServer->enableGrantType($ImplicitGrant, $_one_day);

        return $this->AuthorizationServer;
    }
Get authorization server.

@since 17xxxx OAuth utils.

@return AuthorizationServer Server.