prise en compte protocole

This commit is contained in:
2024-02-16 13:53:54 +01:00
parent 70ea9bff97
commit 1714bd9a70
3 changed files with 3 additions and 9 deletions

View File

@ -135,16 +135,8 @@ class SecurityController extends AbstractController
}
public function loginOAUTH() {
/*
OAUTH_CLIENTID=
OAUTH_CLIENTSECRET=
OAUTH_LOGINURL=https://forge.cadoles.com/login/oauth/authorize
OAUTH_LOGOUTURL=https://forge.cadoles.com/user/logout
OAUTH_TOKENURL=https://forge.cadoles.com/login/oauth/access_token
*/
// https://[YOUR-GITEA-URL]/login/oauth/authorize?client_id=CLIENT_ID&redirect_uri=REDIRECT_URI& response_type=code&state=STATE
$callback=$this->generateUrl('app_login_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL);
$callback=str_replace("http://",$this->getParameter("appProtocol")."://",$callback);
$this->get('session')->set('giteacallback', $callback);
$url=$this->getParameter("oauthLoginurl")."?client_id=".$this->getParameter("oauthClientid")."&redirect_uri=".$callback."&response_type=code&state=STATE";
return $this->redirect($url);