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
Constructors Constructor Description SIPBasicAuthFileValidator(SecurityConfigProperties config)
Autowired Constructor, which just needs the security config properties as bean
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid(SIPBasicAuthAuthenticationToken token)
Checks if a given token is valid
-
-
-
Constructor Detail
-
SIPBasicAuthFileValidator
@Autowired public SIPBasicAuthFileValidator(SecurityConfigProperties config) throws IOException
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 Detail
-
isValid
public boolean isValid(SIPBasicAuthAuthenticationToken token)
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
-
-