Loading docker-compose.certbot.yml +1 −0 Changes for docker-compose.certbot.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ services: # OAUTH2_CLIENT_SECRET: YOUR_OAUTH2_CLIENT_SECRET # OAUTH2_SCOPE: YOUR_OAUTH2_SCOPE # OAUTH2_AUTHORIZATION_URL: YOUR_OAUTH2_AUTHORIZATION_URL # OAUTH2_AUTHORIZATION_CONTENT_TYPE: # One of ['application/x-www-form-urlencoded', 'application/json'] # OAUTH2_TOKEN_URL: YOUR_OAUTH2_TOKEN_URL # OAUTH2_PROFILE_URL: YOUR_OAUTH2_PROFILE_URL # OAUTH2_USER_ATTR_EMAIL: email Loading docker-compose.traefik.yml +1 −0 Changes for docker-compose.traefik.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ services: # OAUTH2_CLIENT_SECRET: YOUR_OAUTH2_CLIENT_SECRET # OAUTH2_SCOPE: YOUR_OAUTH2_SCOPE # OAUTH2_AUTHORIZATION_URL: YOUR_OAUTH2_AUTHORIZATION_URL # OAUTH2_AUTHORIZATION_CONTENT_TYPE: # One of ['application/x-www-form-urlencoded', 'application/json'] # OAUTH2_TOKEN_URL: YOUR_OAUTH2_TOKEN_URL # OAUTH2_PROFILE_URL: YOUR_OAUTH2_PROFILE_URL # OAUTH2_USER_ATTR_EMAIL: email Loading docker-compose.yml +1 −0 Changes for docker-compose.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ services: # OAUTH2_CLIENT_SECRET: YOUR_OAUTH2_CLIENT_SECRET # OAUTH2_SCOPE: YOUR_OAUTH2_SCOPE # OAUTH2_AUTHORIZATION_URL: YOUR_OAUTH2_AUTHORIZATION_URL # OAUTH2_AUTHORIZATION_CONTENT_TYPE: # One of ['application/x-www-form-urlencoded', 'application/json'] # OAUTH2_TOKEN_URL: YOUR_OAUTH2_TOKEN_URL # OAUTH2_PROFILE_URL: YOUR_OAUTH2_PROFILE_URL # OAUTH2_USER_ATTR_EMAIL: email Loading ldap-overleaf-sl/sharelatex/AuthenticationController.js +16 −12 Changes for ldap-overleaf-sl/sharelatex/AuthenticationController.js: 16 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -292,28 +292,33 @@ const AuthenticationController = { }, async oauth2Callback(req, res, next) { console.log(`OAuth, receive code ${req.query.code} and state ${req.query.state}`) const saveState = req.session.oauth2State delete req.session.oauth2State if (saveState !== req.query.state) { console.log("OAuth ", JSON.stringify(user)) return AuthenticationController.finishLogin(false, req, res, next) } try { console.log("OAuth2 code", req.query.code) const tokenResponse = await fetch(process.env.OAUTH2_TOKEN_URL, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json", }, body: JSON.stringify({ const contentType = process.env.OAUTH2_AUTHORIZATION_CONTENT_TYPE || 'application/x-www-form-urlencoded' const bodyParams = { grant_type: "authorization_code", client_id: process.env.OAUTH2_CLIENT_ID, client_secret: process.env.OAUTH2_CLIENT_SECRET, code: req.query.code, redirect_uri: `${process.env.SHARELATEX_SITE_URL}/oauth/callback`, }) } const body = contentType === 'application/json' ? JSON.stringify(bodyParams) : new URLSearchParams(bodyParams).toString() const tokenResponse = await fetch(process.env.OAUTH2_TOKEN_URL, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": contentType, }, body }) const tokenData = await tokenResponse.json() Loading @@ -324,9 +329,8 @@ const AuthenticationController = { headers: { "Accept": "application/json", "Authorization": `Bearer ${tokenData.access_token}`, "Content-Type": "application/json", } }) }); const profile = await profileResponse.json() console.log("OAuth2 user profile", JSON.stringify(profile)) Loading Loading
docker-compose.certbot.yml +1 −0 Changes for docker-compose.certbot.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ services: # OAUTH2_CLIENT_SECRET: YOUR_OAUTH2_CLIENT_SECRET # OAUTH2_SCOPE: YOUR_OAUTH2_SCOPE # OAUTH2_AUTHORIZATION_URL: YOUR_OAUTH2_AUTHORIZATION_URL # OAUTH2_AUTHORIZATION_CONTENT_TYPE: # One of ['application/x-www-form-urlencoded', 'application/json'] # OAUTH2_TOKEN_URL: YOUR_OAUTH2_TOKEN_URL # OAUTH2_PROFILE_URL: YOUR_OAUTH2_PROFILE_URL # OAUTH2_USER_ATTR_EMAIL: email Loading
docker-compose.traefik.yml +1 −0 Changes for docker-compose.traefik.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -169,6 +169,7 @@ services: # OAUTH2_CLIENT_SECRET: YOUR_OAUTH2_CLIENT_SECRET # OAUTH2_SCOPE: YOUR_OAUTH2_SCOPE # OAUTH2_AUTHORIZATION_URL: YOUR_OAUTH2_AUTHORIZATION_URL # OAUTH2_AUTHORIZATION_CONTENT_TYPE: # One of ['application/x-www-form-urlencoded', 'application/json'] # OAUTH2_TOKEN_URL: YOUR_OAUTH2_TOKEN_URL # OAUTH2_PROFILE_URL: YOUR_OAUTH2_PROFILE_URL # OAUTH2_USER_ATTR_EMAIL: email Loading
docker-compose.yml +1 −0 Changes for docker-compose.yml: 1 added line, 0 removed lines. Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ services: # OAUTH2_CLIENT_SECRET: YOUR_OAUTH2_CLIENT_SECRET # OAUTH2_SCOPE: YOUR_OAUTH2_SCOPE # OAUTH2_AUTHORIZATION_URL: YOUR_OAUTH2_AUTHORIZATION_URL # OAUTH2_AUTHORIZATION_CONTENT_TYPE: # One of ['application/x-www-form-urlencoded', 'application/json'] # OAUTH2_TOKEN_URL: YOUR_OAUTH2_TOKEN_URL # OAUTH2_PROFILE_URL: YOUR_OAUTH2_PROFILE_URL # OAUTH2_USER_ATTR_EMAIL: email Loading
ldap-overleaf-sl/sharelatex/AuthenticationController.js +16 −12 Changes for ldap-overleaf-sl/sharelatex/AuthenticationController.js: 16 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -292,28 +292,33 @@ const AuthenticationController = { }, async oauth2Callback(req, res, next) { console.log(`OAuth, receive code ${req.query.code} and state ${req.query.state}`) const saveState = req.session.oauth2State delete req.session.oauth2State if (saveState !== req.query.state) { console.log("OAuth ", JSON.stringify(user)) return AuthenticationController.finishLogin(false, req, res, next) } try { console.log("OAuth2 code", req.query.code) const tokenResponse = await fetch(process.env.OAUTH2_TOKEN_URL, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": "application/json", }, body: JSON.stringify({ const contentType = process.env.OAUTH2_AUTHORIZATION_CONTENT_TYPE || 'application/x-www-form-urlencoded' const bodyParams = { grant_type: "authorization_code", client_id: process.env.OAUTH2_CLIENT_ID, client_secret: process.env.OAUTH2_CLIENT_SECRET, code: req.query.code, redirect_uri: `${process.env.SHARELATEX_SITE_URL}/oauth/callback`, }) } const body = contentType === 'application/json' ? JSON.stringify(bodyParams) : new URLSearchParams(bodyParams).toString() const tokenResponse = await fetch(process.env.OAUTH2_TOKEN_URL, { method: 'POST', headers: { "Accept": "application/json", "Content-Type": contentType, }, body }) const tokenData = await tokenResponse.json() Loading @@ -324,9 +329,8 @@ const AuthenticationController = { headers: { "Accept": "application/json", "Authorization": `Bearer ${tokenData.access_token}`, "Content-Type": "application/json", } }) }); const profile = await profileResponse.json() console.log("OAuth2 user profile", JSON.stringify(profile)) Loading