-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support the implicit grant flow (w/ response_mode=post_form) #1256
base: master
Are you sure you want to change the base?
Conversation
Hey @colemickens i was looking to test this branch out in a k8s cluster, do you mind rebasing to the new repo? The vendoring is off since moving to |
445da8d
to
0ebe5f5
Compare
@colemickens Just wanted to call to your attention that need to resolve the conflict in Thanks. |
0ebe5f5
to
4daf2e1
Compare
@hickey I rebased, and fixed tests so that they pass (locally, at least). Hope this helps. |
@colemickens I hope I am not producing smoke here... I am still learning a lot about OIDC and Dex. Feel free to push this back to me if there are configuration issues on my side. I have built a new Dex (2.13.0) with your branch and I am connecting to Okta. I have tried with both a responseType of 'id_token' and 'code' and in both cases I receive the following error from Dex:
Another 2 things to note is it looks like to me that Dex reports back that it can also accept a response type of token. I get the following back from Dex:
Yet if
Finally, in
I think the last two items are just fixing the code with the expected use cases (assuming that they are valid and I think that they are). As far as the unexpected JSON input that I am getting, I will leave that to those that know more than I do to determine if that is a configuration problem on my side or if this is a real issue. |
This has added the access=offline parameter and prompt=consent parameter to the initial request, this works with google, assuming other providers will ignore the prompt parameter
I didn't realise quite what the migration mechanism was. Have understood it now.
4daf2e1
to
4a29e6f
Compare
Hey @hickey, sorry it took longer to get back to this than I'd hoped. I rebased my branch again, and also created a demo repository: https://github.com/colemickens/dex-portier-demo. It contains config files for Dex (configured to use Small things first:
As for bad connectorData, here are some thoughts on causes, given that the connectorData is serialized on start of flow and deserialized on response from IdP to Dex:
I've added some code that will at least give a different error if the |
1e6df46
to
00a207d
Compare
Signed-off-by: Cole Mickens <[email protected]>
00a207d
to
9ff5eb1
Compare
I have no idea if this will ever be unblocked, but if it were, we might consider not merging it, as it seems like implicit flow is discouraged moving forward: https://developer.okta.com/blog/2019/05/01/is-the-oauth-implicit-flow-dead |
@colemickens I know it's discouraged but some custom IdPs might not support the explicit flow (I have customers in such a situation). It would be great if this could get through. |
Note that implicit flow with |
This stacks on top of @JoelSpeed's #1180 (rebased on
coreos/master
as of today). (The relevant commit is 445da8d)This implements the
implicit
grant flow. This enables the OIDC connector to work with Portier. Portier only supports theimplicit
grant flow and only returns anid_token
.This flow requires a different method for Dex to receive the
id_token
. Given that Dex is a server-side component, it didn't seem prudent to implement theresponse_mode=fragment
, so I implementedresponse_mode=post_form
which was very straightforward.Details:
go-oidc
. I know it removed nonce validation recently, and I'd already implemented it hereresponse_type
so the user can requestid_token
only.response_mode=form_post
, create anonce
, persist it with the in-flightauth_request
.form_post
).Oddities:
We store a dummy value in offline_sessions.connector_data rather than writing a migration to handle a null field (the implicit grant_type doesn't return a refresh token). I'm going to make a note in Implement refreshing with Google #1180 that we might want to allow null for the connector data.
I've not tested with a Kubernetes data store yet.