code-specialist / fastapi-keycloak

Keycloak integration for Python FastAPI
https://fastapi-keycloak.code-specialist.com/
Apache License 2.0
195 stars 51 forks source link

/protected return Not authenticated #95

Closed iopoz closed 1 year ago

iopoz commented 1 year ago

Hello.

I try to use your lib, but i fased with some problems.

I do login http://127.0.0.1:8000/login?username=test_user&password=1234 and get access tocken { "access_token": "eyJhbGci....", "refresh_token": "eyJhb....." }

after that try to execute /protected and get 401 status.

Swagger returns users image

I cant understand that i do wrong. I think problem in keycloak, but i've set it up by https://fastapi-keycloak.code-specialist.com/keycloak_configuration/

Could you take advice where i have to search solution? Thx

iopoz commented 1 year ago

It was my fall. I forgot header