python-keycloak | For review- see https : //github | Identity Management library
kandi X-RAY | python-keycloak Summary
kandi X-RAY | python-keycloak Summary
python-keycloak
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a keycloak token
- Raise an error from a response
- Add client secret key to payload
- Refreshes a refresh token
python-keycloak Key Features
python-keycloak Examples and Code Snippets
Community Discussions
Trending Discussions on python-keycloak
QUESTION
I am in the early stages of building my web application. I intend to use Keycloak as the identity provider to secure the backend. On my local machine, I am running both Keycloak and my backend as docker containers but on different networks, since eventually in production, I would like to have the authentication server running Keycloak running separately from the backend e.g account.example.com
and api.example.com
respectively
Locally, my Keycloak container can be accessed via the base URL http://localhost:8080/auth
and the backend via http://test.localhost:8000/
I have created a client in the Keycloak realm whose access type is confidential. I am generating the token using the authorization code grant type.
Each REST API endpoint on the backend would therefore verify the token passed to the authorization header and then call the Keycloak server to verify the token before processing the request.
The issue that I am currently experiencing is that the token verification fails with the response
...ANSWER
Answered 2022-Jan-13 at 15:52Problem is with the issuer
of the token. Issuer of your token from the postman is http://localhost:8080/...
, but backend is configured to accept only issuer http://host.docker.internal:8080/...
. It is a best practise to use the same protocol:domain[:port]
for IdP (Keycloak in your case) everywhere e.g. https://keycloak.domain.com
, otherwise you will have this kind of problems.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install python-keycloak
You can use python-keycloak like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page