53 lines
1.3 KiB
Java
53 lines
1.3 KiB
Java
package org.mitre.client;
|
|
|
|
import org.springframework.beans.factory.InitializingBean;
|
|
import org.springframework.security.authentication.AuthenticationProvider;
|
|
import org.springframework.security.core.Authentication;
|
|
import org.springframework.security.core.AuthenticationException;
|
|
|
|
public class OpenIdConnectAuthenticationProvider implements
|
|
AuthenticationProvider, InitializingBean {
|
|
|
|
/*
|
|
* (non-Javadoc)
|
|
*
|
|
* @see
|
|
* org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
|
|
*/
|
|
@Override
|
|
public void afterPropertiesSet() throws Exception {
|
|
// TODO Auto-generated method stub
|
|
}
|
|
|
|
/*
|
|
* (non-Javadoc)
|
|
*
|
|
* @see org.springframework.security.authentication.AuthenticationProvider#
|
|
* authenticate(org.springframework.security.core.Authentication)
|
|
*/
|
|
@Override
|
|
public Authentication authenticate(Authentication authentication)
|
|
throws AuthenticationException {
|
|
|
|
if (authentication instanceof OpenIdConnectAuthenticationToken) {
|
|
return authentication;
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
/*
|
|
* (non-Javadoc)
|
|
*
|
|
* @see
|
|
* org.springframework.security.authentication.AuthenticationProvider#supports
|
|
* (java.lang.Class)
|
|
*/
|
|
@Override
|
|
public boolean supports(Class<?> authentication) {
|
|
return OpenIdConnectAuthenticationToken.class
|
|
.isAssignableFrom(authentication);
|
|
}
|
|
|
|
}
|