Skip to content

This project demonstrate of using spring-boot-security-apikey project

License

Notifications You must be signed in to change notification settings

adilkaraoz/spring-boot-security-apikey-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spring-boot-security-apikey-example

This project demonstrates the using of spring-boot-security-apikey project

You can use default api key validator

	defaultApiKeyValidator.addApiKey("your api key here")
	validatorService.setApiKeyValidator(defaultApiKeyValidator);

Also you can define custom api key validator implements from ApiKeyValidatorBase

	class CustomApiKeyValidator implements ApiKeyValidatorBase {

		boolean validate(String apiKey, String requestURI, String referrer) {
			// control apiKey for requestURI and referrer then return true or false here
		}
	
		boolean isEnabled() {
			return true; // If false, validator don't control api key
		}
	}
	
	validatorService.setApiKeyValidator(customApiKeyValidator);

About

This project demonstrate of using spring-boot-security-apikey project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages