You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/opt/freeware/lib/python3.7/site-packages/werkzeug/middleware/dispatcher.py", line 78, in __call__
return app(environ, start_response)
File "/opt/freeware/lib/python3.7/site-packages/flask/app.py", line 2552, in __call__
return self.wsgi_app(environ, start_response)
File "/opt/freeware/lib/python3.7/site-packages/flask/app.py", line 2532, in wsgi_app
response = self.handle_exception(e)
File "/opt/freeware/lib/python3.7/site-packages/flask/app.py", line 2529, in wsgi_app
response = self.full_dispatch_request()
File "/opt/freeware/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/freeware/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/freeware/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/home/tremch/flask/authlib_keycloak_client_test/frontend/__init__.py", line 74, in index
print(str(user.group))
File "/opt/freeware/lib/python3.7/site-packages/authlib/oidc/core/claims.py", line 228, in __getattr__
raise error
File "/opt/freeware/lib/python3.7/site-packages/authlib/oidc/core/claims.py", line 224, in __getattr__
return object.__getattribute__(self, key)
AttributeError: 'UserInfo' object has no attribute 'group'
after adding 'group' to UserInfo class
class UserInfo(dict):
"""The standard claims of a UserInfo object. Defined per `Section 5.1`_.
.. _`Section 5.1`: http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
"""
#: registered claims that UserInfo supports
REGISTERED_CLAIMS = [
'sub', 'name', 'given_name', 'family_name', 'middle_name', 'nickname',
'preferred_username', 'profile', 'picture', 'website', 'email',
'email_verified', 'gender', 'birthdate', 'zoneinfo', 'locale',
'phone_number', 'phone_number_verified', 'address', 'updated_at', 'group',
]
works
root@host: /home/tremch/flask/authlib_keycloak_client_test # /opt/freeware/bin/python3 run.py
Using cacerts from /opt/freeware/lib/python3.7/site-packages/certifi/cacert.pem
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:8700
* Running on http://172.16.84.106:8700
Press CTRL+C to quit
* Restarting with stat
Using cacerts from /opt/freeware/lib/python3.7/site-packages/certifi/cacert.pem
* Debugger is active!
* Debugger PIN: 240-630-255
['dabatestgrp']
10.133.90.37 - - [06/Jun/2023 14:10:47] "GET / HTTP/1.1" 200 -
['dabatestgrp']
10.133.90.37 - - [06/Jun/2023 14:19:50] "GET / HTTP/1.1" 200 -
The text was updated successfully, but these errors were encountered:
Describe the bug
data from session originates from keycloak
trying to print "user.group" value
after adding 'group' to UserInfo class
works
The text was updated successfully, but these errors were encountered: