public function getLoginUrl(array $parameters)
    {
        if ($this->callbackUrl === null) {
            throw new InstagramException('Missing Callback Url', 400);
        }
        
        if (!isset($parameters['scope'])) {
            throw new InstagramException('Missing or Invalid Scope permission used', 400);
        }
        if (count(array_diff($parameters['scope'], $this->defaultScopes)) !== 0) {
            throw new InstagramException('Missing or Invalid Scope permission used', 400);
        }

        $this->scopes = $parameters['scope'];

        $loginUrl = new LoginUrl(
            $this->getApp(),
            $this->getCallbackUrl(),
            $this->getState(),
            $this->scopes
        );

        return $loginUrl->loginUrl();
    }