use of org.springframework.security.saml.spi.DefaultSamlAuthentication in project service-authorization by reportportal.
the class ReportPortalSamlAuthenticationManager method authenticate.
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
if (authentication instanceof DefaultSamlAuthentication) {
ReportPortalSamlAuthentication reportPortalSamlAuthentication = new ReportPortalSamlAuthentication((DefaultSamlAuthentication) authentication);
if (reportPortalSamlAuthentication.isAuthenticated()) {
User user = samlUserReplicator.replicateUser(reportPortalSamlAuthentication);
reportPortalSamlAuthentication.setAuthorities(AuthUtils.AS_AUTHORITIES.apply(user.getRole()));
SecurityContextHolder.getContext().setAuthentication(reportPortalSamlAuthentication);
}
return reportPortalSamlAuthentication;
}
return authentication;
}
Aggregations