Skip to content
Snippets Groups Projects
Commit b7f851a6 authored by Yoan VALLET's avatar Yoan VALLET
Browse files

change the redirect uri sent to enedis for auth

parent 017b1813
Branches
No related tags found
No related merge requests found
Pipeline #5409 passed
......@@ -127,7 +127,7 @@ func main() {
clientId := query.Get("client_id")
state := query.Get("state")
cozyOrigin := query.Get("redirect_uri") // here we use the redirect_uri param to transmit our stack url
redirectUri := "https://oauth-proxy.wf.alpha.grandlyon.com/"
redirectUri := "https://oauth-proxy.wf.alpha.grandlyon.com/redirect"
responseType := "code"
authReq := "https://gw.hml.api.enedis.fr/group/espace-particuliers/consentement-linky/oauth2/authorize?client_id="+ clientId +"&duration=P6M&redirect_uri="+ redirectUri +"&response_type="+ responseType +"&state="+ state +"-"+ cozyOrigin
......@@ -144,13 +144,13 @@ func main() {
fmt.Println(err)
}
// Define the replyUri
replyUri := "https://oauth-proxy.wf.alpha.grandlyon.com/redirect"
fmt.Println(time.Now().Format("2006-01-02 15:04:05"), "- Reply to - ", replyUri)
// replyUri := "https://oauth-proxy.wf.alpha.grandlyon.com/redirect"
// fmt.Println(time.Now().Format("2006-01-02 15:04:05"), "- Reply to - ", replyUri)
// Get the response body as a string
pageContentString := string(contents)
// Replace redirectUri by the host in the body
pageContentString = strings.ReplaceAll(pageContentString, redirectUri, replyUri)
// pageContentString = strings.ReplaceAll(pageContentString, redirectUri, replyUri)
// Prevent the closure of the opener
pageContentString = strings.ReplaceAll(pageContentString, "this.window.opener.location.href = url;", "this.window.location.href = url;")
fmt.Println(pageContentString)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment