request = $request; return $this; } public function setOAuthProvider($provider) { $this->provider = $provider; return $this; } public function render() { $request = $this->request; $provider = $this->provider; $provider_name = phutil_escape_html($provider->getProviderName()); $diagnose = null; $view = new AphrontRequestFailureView(); $view->setHeader($provider->getProviderName().' Auth Failed'); if ($this->request) { $view->appendChild( '
'. 'Description: '. phutil_escape_html($request->getStr('error_description')). '
'); $view->appendChild( ''. 'Error: '. phutil_escape_html($request->getStr('error')). '
'); $view->appendChild( ''. 'Error Reason: '. phutil_escape_html($request->getStr('error_reason')). '
'); } else { // TODO: We can probably refine this. $view->appendChild( 'Unable to authenticate with '.$provider_name.'. '. 'There are several reasons this might happen:
'. 'You can try again, or login using another method.
'); $provider_key = $provider->getProviderKey(); $diagnose = ''. 'Diagnose '.$provider_name.' OAuth Problems'. ''; } $view->appendChild( '