use of com.predic8.membrane.core.interceptor.authentication.session.CleanupThread in project service-proxy by membrane.
the class OAuth2AuthorizationServerInterceptor method init.
@Override
public void init(Router router) throws Exception {
name = "OAuth 2 Authorization Server";
setFlow(Flow.Set.REQUEST_RESPONSE);
this.setRouter(router);
addSupportedAuthorizationGrants();
getWellknownFile().init(router, this);
getConsentPageFile().init(router, getConsentFile());
if (userDataProvider == null)
throw new Exception("No userDataProvider configured. - Cannot work without one.");
if (getClientList() == null)
throw new Exception("No clientList configured. - Cannot work without one.");
if (getClaimList() == null)
throw new Exception("No scopeList configured. - Cannot work without one");
if (getLocation() == null) {
log.warn("===========================================================================================");
log.warn("IMPORTANT: No location configured - Authorization code and implicit flows are not available");
log.warn("===========================================================================================");
loginViewDisabled = true;
}
if (getConsentFile() == null && !isLoginViewDisabled()) {
log.warn("==============================================================================================");
log.warn("IMPORTANT: No consentFile configured - Authorization code and implicit flows are not available");
log.warn("==============================================================================================");
loginViewDisabled = true;
}
if (getPath() == null)
throw new Exception("No path configured. - Cannot work without one");
userDataProvider.init(router);
getClientList().init(router);
getClaimList().init(router);
jwtGenerator = new JwtGenerator();
sessionManager.init(router);
statistics = new OAuth2Statistics();
addDefaultProcessors();
new CleanupThread(sessionManager, accountBlocker).start();
}
use of com.predic8.membrane.core.interceptor.authentication.session.CleanupThread in project service-proxy by membrane.
the class OAuth2ResourceInterceptor method init.
@Override
public void init(Router router) throws Exception {
name = "OAuth 2 Client";
setFlow(Flow.Set.REQUEST_RESPONSE);
super.init(router);
auth.init(router);
statistics = new OAuth2Statistics();
uriFactory = router.getUriFactory();
if (sessionManager == null)
sessionManager = new SessionManager();
// TODO maybe do this differently as now the attribute in the bean is overwritten ( when set from external proxies.xml )
sessionManager.setCookieName("SESSION_ID_CLIENT");
sessionManager.init(router);
if (loginLocation != null) {
wsi = new WebServerInterceptor();
wsi.setDocBase(loginLocation);
router.getResolverMap().resolve(ResolverMap.combine(router.getBaseLocation(), wsi.getDocBase(), "./index.html")).close();
wsi.init(router);
}
if (publicURL == null)
initPublicURLOnFirstExchange = true;
else
normalizePublicURL();
firstInitWhenDynamicAuthorizationService = getAuthService().supportsDynamicRegistration();
if (!getAuthService().supportsDynamicRegistration())
firstInitWhenDynamicAuthorizationService = false;
new CleanupThread(sessionManager).start();
}
Aggregations