Return where the app should redirect internally to initiate SSO request

@return string Init Url
353418
public function getInitUrl() {
        $host = Maestrano::with($this->_preset)->param('app.host');
        $path = $this->getInitPath();
        return "${host}${path}";
    }
1281062
public function init ()
		{
			$access = ( !is_null(Yii::$app->getModule('users')) and Yii::$app->getModule('users')->useAccessControl );
			$rules = [
				[
					'allow'       => true,
					'actions'     => [ 'index' ],
					'controllers' => [ 'site' ],
					'roles'       => [ '?', '@' ]
				],
				[
					'allow'        => true,
					'actions'      => [ 'auth', 'login' ],
					'controllers'  => [ 'user' ],
					'roles'        => [ '?' ],
					'denyCallback' => function ($rule, $action) { Yii::$app->notification->error(Yii::tr('You are already logged in.')); },
				],
				[
					'allow'         => true,
					'actions'       => [],
					'controllers'   => [],
					'roles'         => [ '@' ],
					'matchCallback' => function ($rule, $action)
					{

						if (!Yii::$app->user->identity->active)
						{
							Yii::$app->notification->errorToSession(Yii::tr('Your account is not approved yet.', [], 'user'));
							$action->controller->redirect(Url::toRoute([ '/site/index' ]));
						}

						return true;
					}
				],
			];

			if ($access)
				foreach (Yii::$app->getModule('users')->allowedUnauthorizedRoutes as $url)
				{
					$url = explode('/', trim($url, '/'));
					array_push($rules, [
						'allow'       => true,
						'actions'     => [ array_pop($url) ],
						'controllers' => [ array_shift($url) ],
						'roles'       => [ '?', '@' ]
					]);
				}

			if ($access or count($this->rules) == 0)
				foreach ($rules as $rule)
				{
					if (is_array($rule))
					{
						array_push($this->rules, Yii::createObject(array_merge($this->ruleConfig, $rule)));
					}
				}
			parent::init();
		}
722045
public function getRedirectUri()
	{
		return null === $this->loginAgentUrl ? $this->callbackUrl : ($this->loginAgentUrl . '?' . http_build_query(array('redirect_uri'=>$this->callbackUrl)));
	}
550492
public function getLoginUri()
    {
        $params = array(
            'response_type' => 'code',
            'client_id' => $this->_getClientId(),
            'redirect_uri' => $this->_getRedirectUri(),
            'scope' => $this->_getScope()
        );

        return $this->_getUri($this->_authEndPoint, $params);
    }
726002
public function getLoginUrl()
    {
        // required params
        $params = array(
            'client_id' => $this->getClientId(),
            'redirect_uri' => $this->getRedirectUri(),
        );
        // optional params
        if ($this->getScope()) {
            $params['scope'] = implode(',', $this->getScope());
        }
        if ($this->getResponceType()) {
            $params['response_type'] = $this->getResponceType();
        }
        if ($this->apiVersion) {
            $params['v'] = $this->apiVersion;
        }
        if ($this->state) {
            $params['state'] = $this->state;
        }

        return 'https://oauth.vk.com/authorize?' . http_build_query($params);
    }
297222
public function getAuthenticationUri()
    {

        if (!$this->canBuildAuthenticationUri()) {
            throw new \RuntimeException(
            	'Cannot build authentication uri, dependencies are missing'
            );
        }

        $uriParams = array(
            'client_id' => $this->clientId,
            'response_type' => 'code',
            'redirect_uri' => $this->redirectUri,
        );

        return $this->authorizeUri . '?' . http_build_query($uriParams);

    }
980911
public function init()
    {
        $request =& $this->request;
        $route = '/:controller/:action';
        $opts = array('controller' => 'Home', 'action' => 'index');

        // Inlined as a closure to fix "using $this when not in object context" on 5.3
        $validateSession = function () {
            if (!empty($_SESSION['phpci_user_id'])) {
                $user = b8\Store\Factory::getStore('User')->getByPrimaryKey($_SESSION['phpci_user_id']);

                if ($user) {
                    $_SESSION['phpci_user'] = $user;
                    return true;
                }

                unset($_SESSION['phpci_user_id']);
            }

            return false;
        };

        $skipAuth = array($this, 'shouldSkipAuth');

        // Handler for the route we're about to register, checks for a valid session where necessary:
        $routeHandler = function (&$route, Response &$response) use (&$request, $validateSession, $skipAuth) {
            $skipValidation = in_array($route['controller'], array('session', 'webhook', 'build-status'));

            if (!$skipValidation && !$validateSession() && (!is_callable($skipAuth) || !$skipAuth())) {
                if ($request->isAjax()) {
                    $response->setResponseCode(401);
                    $response->setContent('');
                } else {
                    $_SESSION['phpci_login_redirect'] = substr($request->getPath(), 1);
                    $response = new RedirectResponse($response);
                    $response->setHeader('Location', PHPCI_URL.'session/login');
                }

                return false;
            }

            return true;
        };

        $this->router->clearRoutes();
        $this->router->register($route, $opts, $routeHandler);
    }
1205975
public function getLogin()
    {
        if ($this->guard()->check()) {
            return redirect($this->redirectPath());
        }

        return view($this->loginView);
    }
927699
public function userLoginCallback() {
    $sdk = $this->getSdk('login');

    if ($sdk instanceof RedirectResponse) {
      return $sdk;
    }

    $this->authManager->setSdk($sdk);
    $profile = $this->getProfile('login');

    if ($profile instanceof RedirectResponse) {
      return $profile;
    }

    // Check whether user account exists.
    $account = $this->entityTypeManager()
      ->getStorage('user')
      ->loadByProperties([
        'linkedin_id' => $profile['id'],
      ]);

    if (!$account) {
      return $this->redirect('social_auth_linkedin.user_login_notice');
    }

    $account = current($account);

    if (!$account->get('status')->value) {
      drupal_set_message($this->t('Your account is blocked. Contact the site administrator.'), 'error');
      return $this->redirect('user.login');
    }

    // Authorize the user and redirect him to the account page.
    user_login_finalize($account);

    return $this->redirect('entity.user.canonical', [
      'user' => $account->id(),
    ]);
  }
413357
public function init()
    {
        $this->sessId = $this->attrs->sessId;
        $this->serverId = $this->attrs->serverId;
        $this->path = $this->attrs->path;

        // @TODO: revert timeout after request
        $this->upstream->setTimeouts($this->appInstance->config->networktimeoutread->value,
            $this->appInstance->config->networktimeoutwrite->value);

        $this->opts = $this->appInstance->getRouteOptions($this->attrs->path);
        $this->CORS();
        if ($this->isFinished()) {
            return;
        }
        if ($this->opts['cookie_needed'] && !$this instanceof Info) {
            if (isset($_COOKIE['JSESSIONID'])) {
                $val = $_COOKIE['JSESSIONID'];
                if (!is_string($val) || $val === '') {
                    $val = 'dummy';
                }
            } else {
                $val = 'dummy';
            }
            $this->setcookie('JSESSIONID', $val, 0, '/');
        }
        $this->contentType($this->contentType);
        if (!$this->cacheable) {
            $this->noncache();
            $this->header('X-Accel-Buffering: no');
        }
        if ($this->callbackParamEnabled) {
            if (!isset($_GET['c']) || !is_string($_GET['c']) || preg_match('~[^_\.a-zA-Z0-9]~', $_GET['c'])) {
                $this->header('500 Internal Server Error');
                $this->out('"callback" parameter required');
                $this->finish();
                return;
            }
        }
        if (($f = $this->appInstance->config->heartbeatinterval->value) > 0) {
            $this->heartbeatTimer = setTimeout(function ($timer) {
                if (in_array('one-by-one', $this->pollMode)) {
                    $this->heartbeatOnFinish = true;
                    $this->stop();
                    return;
                }
                $this->sendFrame('h');
                if ($this->gcEnabled) {
                    $this->gcCheck();
                }
            }, $f * 1e6);
        }
        $this->afterHeaders();
        if ($this->poll) {
            $this->acquire(function () {
                $this->poll();
            });
        }
    }
1215399
public function getAuthoriseUrl()
    {
        // Get the request token
        $token = $this->getToken();
    
        // Prepare request parameters
        $params = array(
            'oauth_token' => $token->oauth_token,
            'oauth_token_secret' => $token->oauth_token_secret,
            'oauth_callback' => $this->callback,
        );
    
        // Build the URL and redirect the user
        $query = '?' . http_build_query($params, '', '&');
        $url = self::WEB_URL . self::AUTHORISE_METHOD . $query;
        return $url;
    }
736149
public function sslRedirect()
    {
        if (!$this->isSecure()) {
            $redirect = 'https://' . $this->server['HTTP_HOST'] . $this->server['REQUEST_URI'];

            header('HTTP/1.1 301 Moved Permanently');
            header('Location: ' . $redirect);
            exit();
        }
    }
935533
public function getSelfLink()
    {
        try {
            if ((bool)$this->_getContainer()->getConfig()->getConfigParam('sSSLShopURL') === true
                && !$this->isAdmin()
                && $this->getAmazonLoginIsActive()
            ) {
                return $this->getSslSelfLink();
            }
        } catch (Exception $oException) {
            //Do nothing
        }

        return parent::getSelfLink();
    }
1287606
protected function _redirectToLogin() {
        $this->_storeTargetUrl();

        $auth = Garp_Auth::getInstance();
        $authVars = $auth->getConfigValues();

        $flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger');
        $flashMessenger->addMessage(!$auth->isLoggedIn() ?
            __($authVars['notLoggedInMsg']) : __($authVars['noPermissionMsg']));

        // Make sure the redirect is not cached
        Zend_Controller_Action_HelperBroker::getStaticHelper('cache')->setNoCacheHeaders(
            $this->getResponse());

        $redirector = Zend_Controller_Action_HelperBroker::getStaticHelper('redirector');
        $redirectMethod = 'gotoUrlAndExit';
        $redirectParams = array('/g/auth/login');

        if (!empty($authVars['login']['route'])) {
            $redirectMethod = 'gotoRoute';
            $redirectParams = array(array(), $authVars['login']['route']);
        }
        call_user_func_array(array($redirector, $redirectMethod), $redirectParams);
    }
733452
protected function getRedirectUri()
    {
        if (isset($_POST['redirect'])) {
            return $_POST['redirect'];
        }
        if (isset($_GET['redirect'])) {
            return $_GET['redirect'];
        }
        return \Staq::App()->getCurrentUri();
    }
313535
public function getSignup()
    {
        // Is the user logged in?
        if (Sentinel::check())
        {
            if (Sentinel::inRole('admin'))
                return Redirect::route('home');
            else
                return Redirect::route('user.home');
        }

        // Show the page
        return View('auth.register');
    }
815913
public function getAuthLoginUrl()
    {
        $callback    = $this->getAuthCallbackUrl();
        $clientIdKey = $this->getClientIdKey();
        $clientSKey  = $this->getClientSecretKey();
        $state       = $this->getAuthLoginState();
        $url         = $this->getAuthenticationUrl()
            .'pages/'.$this->keys[$clientIdKey].'.json'
            .'?api_key='.$this->keys[$clientSKey]
            .'&response_type=code'
            .'&redirect_uri='.urlencode($callback)
            .'&state='.$state;

        if ($this->session) {
            $this->session->set($this->getName().'_csrf_token', $state);
        }

        return $url;
    }