com.payneteasy.superfly.security.SuperflyAuthenticationProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of superfly-spring-security Show documentation
Show all versions of superfly-spring-security Show documentation
Module for Spring Security which enables application to use Superfly authentication/authorization declaratively through Spring Security
The newest version!
package com.payneteasy.superfly.security;
import org.springframework.beans.factory.annotation.Required;
import com.payneteasy.superfly.api.SSOService;
import com.payneteasy.superfly.api.SSOUser;
import com.payneteasy.superfly.security.authentication.UsernamePasswordAuthRequestInfoAuthenticationToken;
/**
* Authentication provider which is able to authenticate against the following
* pair: .
*
* @author Roman Puchkovskiy
*/
public class SuperflyAuthenticationProvider extends AbstractSuperflyAuthenticationProvider {
private SSOService ssoService;
@Required
public void setSsoService(SSOService ssoService) {
this.ssoService = ssoService;
}
@Override
protected SSOUser doAuthenticate(
UsernamePasswordAuthRequestInfoAuthenticationToken authRequest,
String username, String password) {
SSOUser ssoUser = ssoService.authenticate(username, password,
authRequest.getAuthRequestInfo());
return ssoUser;
}
}