risdenk commented on a change in pull request #57: KNOX-1191 - Azure AD support
for KnoxSSO
URL: https://github.com/apache/knox/pull/57#discussion_r259450367
##########
File path:
gateway-provider-security-pac4j/src/main/java/org/apache/knox/gateway/pac4j/session/KnoxSessionStore.java
##########
@@ -143,6 +162,22 @@ public void set(WebContext context, String key, Object
value) {
}
cookie.setHttpOnly(true);
cookie.setSecure(ContextHelper.isHttpsOrSecure(context));
+
+ /**
+ * set the correct path for setting pac4j profile cookie.
+ * This is because, Pac4jDispatcherFilter.PAC4J_CALLBACK_PARAMETER in
the path
+ * indicates callback when ? cannot be used.
+ */
+ if (context.getPath() != null && context.getPath()
+ .contains(Pac4jDispatcherFilter.PAC4J_CALLBACK_PARAMETER)) {
+
+ final String[] parts = ((J2EContext)
context).getRequest().getRequestURI()
+ .split(
+ "websso"+ Pac4jDispatcherFilter.URL_PATH_SEPARATOR +
Pac4jDispatcherFilter.PAC4J_CALLBACK_PARAMETER);
Review comment:
Where does the "websso" string come from? Could we do something like
endsWith PAC4J_CALLBACK_PARAMETER to make this check tighter?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services