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
Modifier and TypeFieldDescriptionprotected @NonNull SIPTokenValidator<T>
The token validator which should be used for validation of the authorization object -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal org.springframework.security.core.Authentication
authenticate
(org.springframework.security.core.Authentication authentication) final boolean
protected T
validateAuthentication
(T authentication) The authentication method to be implmented by sip authentication providers.
-
Field Details
-
tokenValidator
The token validator which should be used for validation of the authorization object
-
-
Constructor Details
-
SIPAuthenticationProvider
public SIPAuthenticationProvider()
-
-
Method Details
-
validateAuthentication
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
- Specified by:
supports
in interfaceorg.springframework.security.authentication.AuthenticationProvider
-