This adapter demonstrates how Spring Security can be implemented. It was built using sip-archetype. Spring Security was added to it. To access an endpoint exposed by this adapter a JWT token is required, provided by a keycloak server. All configuration is done in AdapterSecurityConfig.
-
Set up a test keycloak server. This can be done using the following guide or in another preferred way. https://www.keycloak.org/getting-started/getting-started-docker
-
Make sure to apply values to following configuration properties before running the adapter:
ISSUER_URI: # URI of keycloak issuer realm
-
Fetch the token from test keycloak server
-
Attach the token to the request and send it to
GET /adapter/nobelprize/{category}/{year}
.- if the request was successful and token was valid the Nobel Prize data will be the response
- if the token was invalid status Unauthorized will be returned