# Authentication-validator library
This is a spring service which validates jwt access tokens issued by keycloak. \
When it encounters an invalid token, it throws a `ResponseStatusException` with the corresponding HTTP status. \
This service is used by all Gamify-IT backends to validate the users and to require authentication for specific routes.
* [Links](#links)
* [Usage](#usage)
* [Properties](#properties)
* [Needed Dependencies](#needed-dependencies)
* [Class diagram](#class-diagram)
## Links
- The program code can be found [here](https://github.com/Gamify-IT/authentification-validator).
- For more info about the authentication cookie, see the [keycloak manual](./keycloak.md).
## Usage
### Properties
Needs following properties from the application:
| Property key | Environment variable | Description | Example |
|-----------------|----------------------|----------------------------------------------|------------------------------------------------------------|
| keycloak.url | KEYCLOAK_URL | the realm url to fetch the certificates from | keycloak.url=http://localhost/keycloak/realms/Gamify-IT |
| keycloak.issuer | KEYCLOAK_ISSUER | the issuer mentioned in the tokens | keycloak.issuer=http://localhost/keycloak/realms/Gamify-IT |
### Needed Dependencies
```xml
sqa-artifactory
SQA Artifactory-releases
https://rss-artifactory.ddnss.org/artifactory/libs-release
```
```xml
de.uni-stuttgart.gamify-it
authentification-validator
v1.0.0
```
## Class diagram
