-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add modified OIDC authenticator #841
base: main
Are you sure you want to change the base?
Conversation
52695e2
to
eab3d8d
Compare
eab3d8d
to
22b1e0b
Compare
97331ff
to
861f894
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you! Let me test it out locally before we merge.
I push some commits to get this closer to a working state:
At present, (3) does not quite work. Maybe you could take a look from here, @DiamondJoseph? See
|
Actually, I realized that the fix is straightforward. Pushed a couple more commits, and now it works for me: In [14]: c = from_uri('http://localhost:8000')
You have 15 minutes to visit this URL
http://localhost:9000/auth?client_id=example_client_id&response_type=code&scope=openid&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Fapi%2Fv1%2Fauth%2Fprovider%2Fsimple_oidc%2Fdevice_code
and enter the code:
558C-F054
Waiting....
You have logged in with Simple OIDC as example.
# In web browser, I logged in with creds:
#
# [email protected]
# password
#
# and entered the code above when prompted...
In [15]: c
Out[15]: <Container {'A', 'B', 'C', 'D'}>
In [16]: c.context
Out[16]: <Context authenticated as 'example'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks really nice.
FWIW, I tried running this with the supplied local OIDC provider. I was able to authenticate, but received a 500 error when it could not find a "principal" in the db. I'm not sure if I missed something in the config file (in which case we might need to update the docs).
# Run the OIDC provider
docker run --rm -p 9000:9000 -v $(pwd):/config -e CONFIG_FILE=/config/oidc_provider_config.json -e USERS_FILE=/config/users.json docker.io/qlik/simple-oidc-provider:0.2.4
# Run tiled server
OIDC_BASE_URL=http://localhost:9000 OIDC_CLIENT_ID=example_client_id OIDC_CLIENT_SECRET=example_client_secret tiled serve config example_configs/simple_oidc/config.yml
# Excerpt from server error after authentication
...
File ".../tiled/server/authentication.py", line 652, in route
session = await create_session(
^^^^^^^^^^^^^^^^^^^^^
File ".../tiled/server/authentication.py", line 424, in create_session
(new_identity,) = principal.identities
^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'identities'
I haven't seen this before and can't picture how it could happen:
Maybe you could reproduce it on Zoom and we could dig in a bit. |
I could not reproduce this -- neither in the same environment nor in a fresh installation. Let's chalk it up to user error. Subsequent attempts all succeeded. |
Co-authored-by: Padraic Shafer <[email protected]>
Adds an OIDC Authenticator which negotiates with the ID provider rather than providing a specific algorithm
Checklist