use of org.obiba.mica.web.controller.domain.AuthConfiguration in project mica2 by obiba.
the class SignController method getAuthConfiguration.
private AuthConfiguration getAuthConfiguration() {
try {
JSONObject authConfig = userAuthService.getPublicConfiguration();
JSONObject clientConfig = userAuthService.getClientConfiguration();
return new AuthConfiguration(authConfig, clientConfig);
} catch (Exception e) {
return new AuthConfiguration(new JSONObject(), new JSONObject());
}
}
use of org.obiba.mica.web.controller.domain.AuthConfiguration in project mica2 by obiba.
the class ProfileController method getProfile.
@GetMapping("/profile")
public ModelAndView getProfile() {
Subject subject = SecurityUtils.getSubject();
if (subject.isAuthenticated()) {
ModelAndView mv = new ModelAndView("profile");
mv.getModel().put("oidcProviders", userAuthService.getOidcProviders("en"));
mv.getModel().put("authConfig", new AuthConfiguration(userAuthService.getPublicConfiguration(), null));
return mv;
} else {
return new ModelAndView("redirect:signin?redirect=" + micaConfigService.getContextPath() + "/profile");
}
}
Aggregations