Class SIPBasicAuthFileValidator
java.lang.Object
de.ikor.sip.foundation.security.authentication.basic.SIPBasicAuthFileValidator
- All Implemented Interfaces:
SIPTokenValidator<SIPBasicAuthAuthenticationToken>
@Primary
@ConditionalOnSIPAuthProvider(listItemValue=SIPBasicAuthAuthenticationProvider.class,
validationClass=SIPBasicAuthFileValidator.class)
@Component
public class SIPBasicAuthFileValidator
extends Object
implements SIPTokenValidator<SIPBasicAuthAuthenticationToken>
The file-based basic auth validator reads a given json file in this format:
[ {"username": "user1", "password": "pw1"}, {"username": "anotherUser", "password": "anotherPassword"} ]
- Author:
- thomas.stieglmaier
-
Constructor Summary
ConstructorDescriptionAutowired Constructor, which just needs the security config properties as bean -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if a given token is valid
-
Constructor Details
-
SIPBasicAuthFileValidator
Autowired Constructor, which just needs the security config properties as bean- Parameters:
config
- the configs to be read- Throws:
IOException
- if the configured basic auth settings file is not valid json
-
-
Method Details
-
isValid
Description copied from interface:SIPTokenValidator
Checks if a given token is valid- Specified by:
isValid
in interfaceSIPTokenValidator<SIPBasicAuthAuthenticationToken>
- Parameters:
token
- the token to be checked- Returns:
- indicates if the token is valid or not
-