use of com.tremolosecurity.idp.providers.OpenIDConnectIdP in project OpenUnison by TremoloSecurity.
the class OpenIDConnectToken method replaceState.
public void replaceState() throws Exception {
HashMap<String, OpenIDConnectIdP> oidcIdPs = (HashMap<String, OpenIDConnectIdP>) GlobalEntries.getGlobalEntries().get(OpenIDConnectIdP.UNISON_OPENIDCONNECT_IDPS);
OpenIDConnectIdP idp = oidcIdPs.get(this.idpName);
try {
this.oidcSession = idp.getSessionStore().getSession(this.oidcSession.getSessionID());
} catch (Exception e) {
logger.warn("Could not replace state");
}
}
use of com.tremolosecurity.idp.providers.OpenIDConnectIdP in project OpenUnison by TremoloSecurity.
the class OpenIDConnectToken method getRefreshToken.
public String getRefreshToken() throws Exception {
HashMap<String, OpenIDConnectIdP> idps = (HashMap<String, OpenIDConnectIdP>) GlobalEntries.getGlobalEntries().get(OpenIDConnectIdP.UNISON_OPENIDCONNECT_IDPS);
OpenIDConnectIdP idp = idps.get(this.idpName);
return idp.getSessionStore().getSession(this.oidcSession.getSessionID()).getRefreshToken();
}
use of com.tremolosecurity.idp.providers.OpenIDConnectIdP in project OpenUnison by TremoloSecurity.
the class OpenIDConnectToken method refreshProxyToken.
public void refreshProxyToken(HttpServletRequest request) throws ServletException, MalformedURLException, MalformedClaimException, JoseException, LDAPException, ProvisioningException {
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);
}
use of com.tremolosecurity.idp.providers.OpenIDConnectIdP in project OpenUnison by TremoloSecurity.
the class ClearSessions method execute.
@Override
public void execute(ConfigManager cfg, JobExecutionContext job) throws ProvisioningException {
String idpName = job.getJobDetail().getJobDataMap().getString("idpName");
HashMap<String, OpenIDConnectIdP> oidcIdPs = (HashMap<String, OpenIDConnectIdP>) GlobalEntries.getGlobalEntries().get(OpenIDConnectIdP.UNISON_OPENIDCONNECT_IDPS);
if (oidcIdPs == null) {
logger.warn("No openid connect identity providers available yet");
return;
}
OpenIDConnectIdP idp = oidcIdPs.get(idpName);
idp.clearExpiredSessions();
}
use of com.tremolosecurity.idp.providers.OpenIDConnectIdP 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