use of edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage.RefreshTokenRetentionPolicy in project OA4MP by ncsa.
the class OA2ServletInitializer method init.
@Override
public void init() throws ServletException {
if (isInitRun)
return;
super.init();
OA2SE oa2SE = (OA2SE) getEnvironment();
MyProxyDelegationServlet mps = (MyProxyDelegationServlet) getServlet();
try {
// mps.storeUpdates();
mps.processStoreCheck(oa2SE.getPermissionStore());
mps.processStoreCheck(oa2SE.getAdminClientStore());
} catch (SQLException e) {
if (DebugUtil.isEnabled()) {
e.printStackTrace();
}
throw new ServletException("Could not update table", e);
}
if (oa2SE.isRefreshTokenEnabled()) {
// We need a different set of policies than the original one.
MyProxyDelegationServlet.transactionCleanup.getRetentionPolicies().clear();
MyProxyDelegationServlet.transactionCleanup.addRetentionPolicy(new RefreshTokenRetentionPolicy((RefreshTokenStore) oa2SE.getTransactionStore()));
oa2SE.getMyLogger().info("Initialized refresh token cleanup thread");
}
if (!ClaimSourceFactory.isFactorySet()) {
ClaimSourceFactory.setFactory(new LDAPClaimSourceFactory());
}
try {
SATFactory.setAdminClientConverter(AdminClientStoreProviders.getAdminClientConverter());
SATFactory.setClientConverter((ClientConverter<? extends Client>) oa2SE.getClientStore().getACConverter());
} catch (Exception e) {
e.printStackTrace();
}
}
Aggregations