|
|
@ -70,6 +70,7 @@ public class JITProvisionHandler extends HttpServlet {
|
|
|
|
private String encodedClientCredentials;
|
|
|
|
private String encodedClientCredentials;
|
|
|
|
private String JITConfigurationPath;
|
|
|
|
private String JITConfigurationPath;
|
|
|
|
private String redirectUrl;
|
|
|
|
private String redirectUrl;
|
|
|
|
|
|
|
|
private String state;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
|
|
|
|
protected void doGet(HttpServletRequest request, HttpServletResponse response) {
|
|
|
@ -83,6 +84,7 @@ public class JITProvisionHandler extends HttpServlet {
|
|
|
|
+ HandlerConstants.JIT_PROVISION_CALLBACK_URL;
|
|
|
|
+ HandlerConstants.JIT_PROVISION_CALLBACK_URL;
|
|
|
|
JITConfigurationPath = CarbonUtils.getCarbonConfigDirPath() + File.separator + "jit-config.xml";
|
|
|
|
JITConfigurationPath = CarbonUtils.getCarbonConfigDirPath() + File.separator + "jit-config.xml";
|
|
|
|
String scope = "openid";
|
|
|
|
String scope = "openid";
|
|
|
|
|
|
|
|
state = HandlerUtil.generateStateToken();
|
|
|
|
tenantDomain = request.getParameter("tenantDomain");
|
|
|
|
tenantDomain = request.getParameter("tenantDomain");
|
|
|
|
redirectUrl = request.getParameter("redirectUrl");
|
|
|
|
redirectUrl = request.getParameter("redirectUrl");
|
|
|
|
JITServiceProviderName = request.getParameter("sp");
|
|
|
|
JITServiceProviderName = request.getParameter("sp");
|
|
|
@ -100,7 +102,7 @@ public class JITProvisionHandler extends HttpServlet {
|
|
|
|
response.sendRedirect(keyManagerUrl + HandlerConstants.AUTHORIZATION_ENDPOINT +
|
|
|
|
response.sendRedirect(keyManagerUrl + HandlerConstants.AUTHORIZATION_ENDPOINT +
|
|
|
|
"?response_type=code" +
|
|
|
|
"?response_type=code" +
|
|
|
|
"&client_id=" + clientId +
|
|
|
|
"&client_id=" + clientId +
|
|
|
|
"&state=" +
|
|
|
|
"&state=" + state +
|
|
|
|
"&scope=" + scope +
|
|
|
|
"&scope=" + scope +
|
|
|
|
"&redirect_uri=" + JITCallbackUrl);
|
|
|
|
"&redirect_uri=" + JITCallbackUrl);
|
|
|
|
} catch (JITProvisionException | IOException ex) {
|
|
|
|
} catch (JITProvisionException | IOException ex) {
|
|
|
@ -129,6 +131,7 @@ public class JITProvisionHandler extends HttpServlet {
|
|
|
|
JITInfo.setRedirectUrl(redirectUrl);
|
|
|
|
JITInfo.setRedirectUrl(redirectUrl);
|
|
|
|
JITInfo.setSp(JITServiceProviderName);
|
|
|
|
JITInfo.setSp(JITServiceProviderName);
|
|
|
|
session.setMaxInactiveInterval(3600);
|
|
|
|
session.setMaxInactiveInterval(3600);
|
|
|
|
|
|
|
|
session.setAttribute("state", state);
|
|
|
|
session.setAttribute(HandlerConstants.SESSION_JIT_DATA_KEY, JITInfo);
|
|
|
|
session.setAttribute(HandlerConstants.SESSION_JIT_DATA_KEY, JITInfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|