use of it.unibo.arces.wot.sepa.commons.security.ClientSecurityManager in project SEPA by arces-wot.
the class ConfigurationProvider method buildSecurityManager.
private ClientSecurityManager buildSecurityManager() throws SEPASecurityException, SEPAPropertiesException {
ClientSecurityManager sm = null;
if (appProfile.isSecure()) {
sm = new ClientSecurityManager(appProfile.getAuthenticationProperties());
if (!appProfile.getAuthenticationProperties().isClientRegistered()) {
Response ret = sm.registerClient(getClientId(), appProfile.getAuthenticationProperties().getUsername(), appProfile.getAuthenticationProperties().getInitialAccessToken());
if (ret.isError())
throw new SEPASecurityException(getClientId() + " registration failed");
}
sm.refreshToken();
appProfile.getAuthenticationProperties().storeProperties();
}
return sm;
}
Aggregations