Last active
November 18, 2016 10:19
-
-
Save yesil/dcb3697376ce07004b0202bb9424fb5d to your computer and use it in GitHub Desktop.
Simple proxy to alter the POST request content that is sent IdP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "samlproxy", | |
"version": "1.0.0", | |
"description": "", | |
"main": "server.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "Ilyas Türkben", | |
"license": "ISC", | |
"dependencies": { | |
"http-proxy": "^1.15.2" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var httpProxy = require('http-proxy') | |
var http = require('http') | |
var proxy = new httpProxy.createProxyServer({ | |
target: { | |
host: 'idp', | |
port: 9015 | |
} | |
}) | |
proxy.on('proxyReq', function (proxyReq, req, res, options) { | |
proxyReq.write("RelayState=https%3A%2F%2Fidp.test&") | |
}) | |
var proxyServer = http.createServer(function (req, res) { | |
proxy.web(req, res) | |
}) | |
proxyServer.listen(8015) |
Author
yesil
commented
Nov 18, 2016
•
- Download package.json and server.js
- npm install
- In AEM set the IdP host to this proxy and put the real IdP post & port in server.js (lines 6-7)
- Modify line 12 for adding new request parameters to IdP
- npm start
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment