Skip to content

Instantly share code, notes, and snippets.

@wstrange
Created November 5, 2013 00:50
Show Gist options
  • Save wstrange/7312009 to your computer and use it in GitHub Desktop.
Save wstrange/7312009 to your computer and use it in GitHub Desktop.
OpenIG Sample config.json showing Tomcat form login
{
"_comment" : "Sample OpenIG config for tomcat form login. Assumes tomcat samples are deployed to instance localhost:48080",
"heap":{
"objects":[
{
"name":"HandlerServlet",
"type":"HandlerServlet",
"config":{
"handler":"DispatchHandler",
"baseURI":"http://openam.example.com:48080/"
}
},
{
"name":"DispatchHandler",
"type":"DispatchHandler",
"config":{
"bindings":[
{
"condition":"${exchange.request.uri.path == '/examples/jsp/security/protected/login.jsp'}",
"handler":"LoginChain",
},
{
"handler":"OutgoingChain",
}
]
}
},
{
"name":"LoginChain",
"type":"Chain",
"config":{
"filters":[
"CryptoHeaderFilter",
],
"handler":"LoginRedirectHandler"
}
},
{
"name":"CryptoHeaderFilter",
"type":"CryptoHeaderFilter",
"config":{
"messageType":"REQUEST",
"operation":"DECRYPT",
"algorithm":"DES/ECB/NoPadding",
"key":"9/uh07wvQ9Y=",
"keyType":"DES",
"charSet":"utf-8",
"headers":[
"password"
],
},
},
{
"name":"LoginRedirectHandler",
"type":"StaticResponseHandler",
"config":{
"status":302,
"reason":"Found",
"headers":{
"Location":[
"http://openam.example.com:28080/examples/jsp/security/protected/j_security_check?j_username=${exchange.request.headers['username'][0]}&j_password=${exchange.request.headers['password'][0]}"
]
}
}
},
{
"name":"OutgoingChain",
"type":"Chain",
"config":{
"filters":[
"CaptureFilter",
],
"handler":"ClientHandler"
}
},
{
"name":"CaptureFilter",
"type":"CaptureFilter",
"config":{
"captureEntity":true,
"file":"/tmp/gateway.log",
}
},
{
"name":"ClientHandler",
"type":"ClientHandler",
"config":{
}
},
{
"name":"LogSink",
"comment":"Default sink for logging information.",
"type":"ConsoleLogSink",
"config":{
"level":"DEBUG"
}
},
]
},
"servletObject":"HandlerServlet",
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment