Object non evaluated on getting decoded_token from Keycloak
See original GitHub issueIssue Description
How to reproduce ?
Env preparation.
pipenv install fastapi fastapi-keycloak
I followed your quickstart and full example instructions then :
pipenv run python main.py
What the result?
pipenv run python main.py
Traceback (most recent call last):
File "main.py", line 10, in <module>
idp = FastAPIKeycloak(
File "/home/germainlef/.local/share/virtualenvs/auth-keycloak-WIW7vmvr/lib/python3.8/site-packages/fastapi_keycloak/api.py", line 125, in __init__
self._get_admin_token() # Requests an admin access token on startup
File "/home/germainlef/.local/share/virtualenvs/auth-keycloak-WIW7vmvr/lib/python3.8/site-packages/fastapi_keycloak/api.py", line 285, in _get_admin_token
self.admin_token = response.json()['access_token']
File "/home/germainlef/.local/share/virtualenvs/auth-keycloak-WIW7vmvr/lib/python3.8/site-packages/fastapi_keycloak/api.py", line 154, in admin_token
if not decoded_token.get('resource_access').get('realm-management') or not decoded_token.get('resource_access').get('account'):
AttributeError: 'NoneType' object has no attribute 'get'
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
mapping OAuth2 claims with roles to secure Resource Server ...
I have tested both solutions using Spring Boot 2.1.9.RELEASE, Spring Security 5.2.0.RELEASE and an official Keycloak 7.0.0 Docker image.
Read more >Authorization Services Guide - Keycloak
A permission associates the object being protected with the policies that must be evaluated to determine whether access is granted.
Read more >Open ID: connecting Keycloak and RabbitMQ [Part 2] - Codetain
Our proxy is running at keycloak-proxy:3000 address. ... We need body-parser package to get the content of request received from message ...
Read more >scryptmouse/keycloak_rack: Rack middleware for ... - GitHub
Rack middleware for validating authorization tokens from Keycloak - GitHub ... If true, authentication will not provided a decoded token instance, true.
Read more >Use AWS Lambda authorizers with a third-party identity ...
In order to use these non-AWS tokens to control access to ... The Lambda authorizer is invoked with the following object as the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Okey!!! I missed something… my bad
Service Accounts Roles was added to test-client instead of admin-cli.
Absolutly!
I have scripted this part to avoid hands mistakes