augustin-wien / augustina-backend

An open-source web shop designed for selling magazines on the street.
GNU Affero General Public License v3.0
4 stars 0 forks source link

Add admin auth middleware #44

Closed nanu-c closed 12 months ago

nanu-c commented 1 year ago

Type of change

Description

This introduces an auth admin + vendor middleware. This needs a re-import to keycloak because of the missing openid scope that isn't standard in keycloak 20 anymore. That means the userinfo endpoint doesn't work.

Bonus: enable the linter #33

Checklist:

nanu-c commented 1 year ago

Everything looks good except for a little typo. Only thing not working for me locally is testing it in my own docker container. Either I get /api/vendors/ expected status code 200, got 401: Unauthorized or Error logging in Keycloak admin could not get token: Post "http://localhost:8080/realms/master/protocol/openid-connect/token": dial tcp 127.0.0.1:8080: connect: connection refused Screenshot from 2023-09-19 16-20-40

the keycloak url in the .env must be http://keycloak:8080