/
Spring Framework Security

Spring Framework Security

LocatorAPI usages Springframework.security dependency for security the endpoints. This in-memory authentication can be configured in the .env file. A user can be defined in an environment file by specifying the username and password credentials. The contents of the file would look something like this:

SPRING_SECURITY_USER_NAME={{username}} SPRING_SECURITY_USER_PASSWORD={{password}}

Or if you need multiple users, then we need to store the credentials for each user in a structured format that the application can read and processed. In LocatorAPI, we use CSV format to separate the credentials. An example of .env file will look as below:

SPRING_SECURITY_USERS=user1,password1,ROLE_USER;user2,password2,ROLE_ADMIN

 

Related content