Class SIPAuthenticationProvider<T extends SIPAuthenticationToken<T>>
java.lang.Object
de.ikor.sip.foundation.security.authentication.SIPAuthenticationProvider<T>
- Type Parameters:
T- the type ofSIPAuthenticationTokenhandled 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
FieldsModifier and TypeFieldDescriptionprotected @NonNull SIPTokenValidator<T>The token validator which should be used for validation of the authorization object -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal org.springframework.security.core.Authenticationauthenticate(org.springframework.security.core.Authentication authentication) final booleanprotected TvalidateAuthentication(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 theisAuthenticatedflag 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:
authenticatein interfaceorg.springframework.security.authentication.AuthenticationProvider- Throws:
org.springframework.security.core.AuthenticationException
-
supports
- Specified by:
supportsin interfaceorg.springframework.security.authentication.AuthenticationProvider
-