Search in sources :

Example 1 with OpenIDConnectAccessToken

use of com.tremolosecurity.idp.providers.OpenIDConnectAccessToken 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());
}
Also used : ServletException(javax.servlet.ServletException) UrlHolder(com.tremolosecurity.config.util.UrlHolder) HashMap(java.util.HashMap) OpenIDConnectAccessToken(com.tremolosecurity.idp.providers.OpenIDConnectAccessToken) OpenIDConnectIdP(com.tremolosecurity.idp.providers.OpenIDConnectIdP) AuthController(com.tremolosecurity.proxy.auth.AuthController)

Aggregations

UrlHolder (com.tremolosecurity.config.util.UrlHolder)1 OpenIDConnectAccessToken (com.tremolosecurity.idp.providers.OpenIDConnectAccessToken)1 OpenIDConnectIdP (com.tremolosecurity.idp.providers.OpenIDConnectIdP)1 AuthController (com.tremolosecurity.proxy.auth.AuthController)1 HashMap (java.util.HashMap)1 ServletException (javax.servlet.ServletException)1