Class SIPAuthenticationProvider<T extends SIPAuthenticationToken<T>>
- java.lang.Object
-
- de.ikor.sip.foundation.security.authentication.SIPAuthenticationProvider<T>
-
- Type Parameters:
T
- the type ofSIPAuthenticationToken
handled by this authentication provider
- All Implemented Interfaces:
org.springframework.security.authentication.AuthenticationProvider
- Direct Known Subclasses:
SIPBasicAuthAuthenticationProvider
,SIPX509AuthenticationProvider
public abstract class SIPAuthenticationProvider<T extends SIPAuthenticationToken<T>> extends Object implements org.springframework.security.authentication.AuthenticationProvider
Base class for sip authentication providers.- Author:
- thomas.stieglmaier
-
-
Field Summary
Fields Modifier and Type Field Description protected @NonNull SIPTokenValidator<T>
tokenValidator
The token validator which should be used for validation of the authorization object
-
Constructor Summary
Constructors Constructor Description SIPAuthenticationProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.Authentication
authenticate(org.springframework.security.core.Authentication authentication)
boolean
supports(Class<?> authentication)
protected T
validateAuthentication(T authentication)
The authentication method to be implmented by sip authentication providers.
-
-
-
Field Detail
-
tokenValidator
@NonNull protected @NonNull SIPTokenValidator<T extends SIPAuthenticationToken<T>> tokenValidator
The token validator which should be used for validation of the authorization object
-
-
Method Detail
-
validateAuthentication
protected T validateAuthentication(T authentication)
The authentication method to be implmented by sip authentication providers. By default it just calls the token validator, and if the token is valid, the same token is returned with theisAuthenticated
flag set to true. Otherwise the token from the argument is returned as it was.If necessary this method can be overridden to provide a more sophisticated validation logic.
- Parameters:
authentication
- the token which should be checked for proper authentication- Returns:
- a token which is either authenticated or not (can be the same as the input)
-
authenticate
public final org.springframework.security.core.Authentication authenticate(org.springframework.security.core.Authentication authentication) throws org.springframework.security.core.AuthenticationException
- Specified by:
authenticate
in interfaceorg.springframework.security.authentication.AuthenticationProvider
- Throws:
org.springframework.security.core.AuthenticationException
-
supports
public final boolean supports(Class<?> authentication)
- Specified by:
supports
in interfaceorg.springframework.security.authentication.AuthenticationProvider
-
-