use of com.tremolosecurity.proxy.auth.AuthController in project OpenUnison by TremoloSecurity.
the class OpenIDConnectToken method generateToken.
public void generateToken(HttpServletRequest request) throws ServletException, JoseException, LDAPException, ProvisioningException, MalformedClaimException, UnsupportedEncodingException, IOException {
AuthController ac = ((AuthController) request.getSession().getAttribute(ProxyConstants.AUTH_CTL));
HashMap<String, OpenIDConnectIdP> idps = (HashMap<String, OpenIDConnectIdP>) GlobalEntries.getGlobalEntries().get(OpenIDConnectIdP.UNISON_OPENIDCONNECT_IDPS);
OpenIDConnectIdP idp = idps.get(this.idpName);
if (idp == null) {
throw new ServletException("Could not find idp '" + this.idpName + "'");
}
generateClaimsData(ac, idp, request);
UrlHolder holder = (UrlHolder) request.getAttribute(ProxyConstants.AUTOIDM_CFG);
OpenIDConnectAccessToken accessToken = new OpenIDConnectAccessToken();
oidcSession = idp.createUserSession(request, this.trustName, holder, idp.getTrusts().get(this.trustName), ac.getAuthInfo().getUserDN(), GlobalEntries.getGlobalEntries().getConfigManager(), accessToken, UUID.randomUUID().toString(), ac.getAuthInfo().getAuthChain());
}
Aggregations