public function authenticate($url = null, $stateOptions = [])
    {
        $loginURL = $url === null ? $this->credentials['loginURL'] : $url;

        $stateOptions['loginUrl'] = $loginURL;
        $state = '&state='.urlencode(json_encode($stateOptions));
        $parameters = $this->settings['parameters'];

        $loginURL .= '/services/oauth2/authorize';
        $loginURL .= '?response_type=code';
        $loginURL .= '&client_id='.$this->credentials['consumerKey'];
        $loginURL .= '&redirect_uri='.urlencode($this->credentials['callbackURI']);
        $loginURL .= !empty($parameters['display']) ? '&display='.$parameters['display'] : '';
        $loginURL .= $parameters['immediate'] ? '&immediate=true' : '';
        $loginURL .= !empty($parameters['scope']) ? '&scope='.rawurlencode($parameters['scope']) : '';
        $loginURL .= !empty($parameters['prompt']) ? '&prompt='.rawurlencode($parameters['prompt']) : '';
        $loginURL .= $state;

        return $this->redirect->to($loginURL);
    }
public function authenticate($url = null, $stateOptions = [])
    {
        $loginURL = $url === null ? $this->credentials['loginURL'] : $url;

        $stateOptions['loginUrl'] = $loginURL;
        $state = '&state='.urlencode(json_encode($stateOptions));
        $parameters = $this->settings['parameters'];

        $loginURL .= '/services/oauth2/authorize';
        $loginURL .= '?response_type=code';
        $loginURL .= '&client_id='.$this->credentials['consumerKey'];
        $loginURL .= '&redirect_uri='.urlencode($this->credentials['callbackURI']);
        $loginURL .= !empty($parameters['display']) ? '&display='.$parameters['display'] : '';
        $loginURL .= $parameters['immediate'] ? '&immediate=true' : '';
        $loginURL .= !empty($parameters['scope']) ? '&scope='.rawurlencode($parameters['scope']) : '';
        $loginURL .= !empty($parameters['prompt']) ? '&prompt='.rawurlencode($parameters['prompt']) : '';
        $loginURL .= $state;

        return $this->redirect->to($loginURL);
    }
public function authenticate ( $ url = null , $ stateOptions = [ ] ) { $ loginURL = $ url === null ? $ this -> credentials [ 'loginURL' ] : $ url ; $ stateOptions [ 'loginUrl' ] = $ loginURL ; $ state = '&state=' . urlencode ( json_encode ( $ stateOptions ) ) ; $ parameters = $ this -> settings [ 'parameters' ] ; $ loginURL .= '/services/oauth2/authorize' ; $ loginURL .= '?response_type=code' ; $ loginURL .= '&client_id=' . $ this -> credentials [ 'consumerKey' ] ; $ loginURL .= '&redirect_uri=' . urlencode ( $ this -> credentials [ 'callbackURI' ] ) ; $ loginURL .= ! empty ( $ parameters [ 'display' ] ) ? '&display=' . $ parameters [ 'display' ] : '' ; $ loginURL .= $ parameters [ 'immediate' ] ? '&immediate=true' : '' ; $ loginURL .= ! empty ( $ parameters [ 'scope' ] ) ? '&scope=' . rawurlencode ( $ parameters [ 'scope' ] ) : '' ; $ loginURL .= ! empty ( $ parameters [ 'prompt' ] ) ? '&prompt=' . rawurlencode ( $ parameters [ 'prompt' ] ) : '' ; $ loginURL .= $ state ; return $ this -> redirect -> to ( $ loginURL ) ; }
Call this method to redirect user to login page and initiate
the Web Server OAuth Authentication Flow.

@param null $loginURL

@return \Illuminate\Http\RedirectResponse
Call this method to redirect user to login page and initiate the Web Server OAuth Authentication Flow .