From d939506823a3246739945d104ee40539587fa656 Mon Sep 17 00:00:00 2001
From: Hugo <hnouts@grandlyon.com>
Date: Thu, 8 Oct 2020 16:33:52 +0200
Subject: [PATCH] grdf endpoints on master

---
 main.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/main.go b/main.go
index 8752a68..197e38d 100644
--- a/main.go
+++ b/main.go
@@ -166,10 +166,10 @@ func main() {
 		}
 		instanceName := cozyOrigin[splitIndexStart+3:splitIndexEnd]
 
-		redirectProxy := "https://oauth-proxy.wf.alpha.grandlyon.com"
+		redirectProxy := "https://oauth-proxy.wf.alpha.grandlyon.com/redirect-grdf"
 		authURL := "https://sofit-sso-oidc.grdf.fr/openam/oauth2/realms/externeGrdf/authorize"
 
-		redirectUrl := authURL + "?client_id=" + clientId + "&scope=openid&response_type=code&redirect_uri="+ redirectProxy + "&state=" + state + "-" + instanceName
+		redirectUrl := authURL + "?client_id=" + clientId + "&scope=openid&response_type=code&redirect_uri="+ redirectProxy + "&login_hint=Sebastien|Riera|sebastien.riera@laposte.net|Ecolyo&state=" + state + "-" + instanceName
 
 		// TODO Add Login Hint in request
 		log.Debug("Redirect to - ", redirectUrl)
@@ -227,7 +227,7 @@ func main() {
 		state := req_state[0:splitIndex]
 		host := req_state[splitIndex+1:]
 
-		cozyURL := "https://" + host + "." + *cozyDomain + *cozyGrdfRedirectURI
+		cozyURL := "https://" + host + "." + "pchugo.wf.alpha.grandlyon.com" + *cozyGrdfRedirectURI
 
 		redir := cozyURL + "?code=" + code + "&state=" + state
 		log.Debug("Redirect to -", redir)
-- 
GitLab