Skip to content
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

Idp specific default flows #123

Merged
merged 10 commits into from
Nov 11, 2021

Conversation

houdini91
Copy link
Contributor

@houdini91 houdini91 commented Oct 19, 2021

Suggestion:
Adding interactive flows for each specific identity provider, allowing users to skip the main idp selection page.
I think one less click can improve the UX a bit.
Further UX improvement is gained when browser uses a default idp account the user does may not need to interactively intervene at all.
Such psodo-auto flow may also be valuable in automation uses cases, for example a git hook signing SLSA provenance.

Hope this helps .
mikey strauss

open a specific Idp web flow for user - skipping the main select idp page

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@bobcallaway
Copy link
Member

This is an interesting idea, but hard-codes the current deployment state of the public service into the (hopefully) more generic codebase, which I'd generally like to avoid. If we were to switch to a different provider (e.g. keycloak), this would require code changes to adapt.

I think you can append connector_id=github-sigstore-prod as a query parameter to the configured auth URL to automatically select github.

@houdini91
Copy link
Contributor Author

houdini91 commented Oct 20, 2021

@bobcallaway
Hi,
I agree your suggestion is better (And also works), let me see if understood correctly.
I changed InteractiveIDTokenGetter to support extra options to be added to the auth URL.
Added example flows as usage example of the change (should i delete the examples so there is no hardcoded values of the public service?, maybe i can move them somewhere else in code base?).

Or maybe you meant application using Sigstore library will implement there own OIDConnect function, with the modified auth URL?

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Copy link
Member

@bobcallaway bobcallaway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with the additions to the InteractiveTokenGetter struct (minus the nit about the field name). Are you thinking we should leave in the changes in pkg/oauthflow/flow.go or were they there just as an example?

pkg/oauthflow/interactive.go Outdated Show resolved Hide resolved
pkg/oauthflow/interactive.go Outdated Show resolved Hide resolved
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@houdini91
Copy link
Contributor Author

houdini91 commented Oct 21, 2021

@bobcallaway
Fixed your comments,
flow.go are working objects (on the public instance) and may be useful for library users (such as cosign).
I would leave them if it was up to me, maybe find a other place to import the public instance specific url option and constsants.
I thought you preferred i don't add that part to the pull-request, leaving the implementation to the library users.
What do you think?

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@houdini91
Copy link
Contributor Author

@bobcallaway
Removed the flow.go changes, it may help speed up the review.

@houdini91
Copy link
Contributor Author

Turns out #sigstore/fulcio#204 broke the connector_id argument.
I am closing this PR.

@houdini91 houdini91 closed this Oct 31, 2021
@bobcallaway
Copy link
Member

the connector IDs did change, but I think this patch is still valid if we update them to match...

@bobcallaway bobcallaway reopened this Nov 1, 2021
@houdini91
Copy link
Contributor Author

@bobcallaway
If you think it's still possible I be happy to continue.
Can you point me on the right direction?

@houdini91
Copy link
Contributor Author

houdini91 commented Nov 2, 2021

@bobcallaway
i think understand correct me if i am wrong.

I can use the new connector_ids values to choose between idps.
I tested the new Ids and they seem to work.

https://github.com/login/oauth
https://accounts.google.com
https://login.microsoftonline.com

After the change do the Default(privider)IDTokenGetter make more sense as part of the code base?

@bobcallaway
Copy link
Member

After the change do the Default(privider)IDTokenGetter make more sense as part of the code base?

I think its fine if you want to put them in.

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@@ -36,6 +37,11 @@ const htmlPage = `<html>
</html>
`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should add some comments to these (as well as updating the names) to denote that they are only meant to be used with oauth2.sigstore.dev ; otherwise this LGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated a bit of names and comments
Did you mean renaming the Default[provider]IDTokenGetter as well?
Is there any specific naming prefix you would rather?
PublicInstance, SigstoreDev, .. ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with PublicInstance as you propose here. I think with renaming the IDTokenGetters we'd be ready to merge this. Thanks for the persistence on getting this to the finish line :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, its my pleasure thanks for the review.
Its my first contribution slowly i hope to have help out.
If you like you can take a look at other PR's i have open on cosign and go-securesystemslib.

Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
Signed-off-by: houdini91 <mdstrauss91@gmail.com>
@bobcallaway bobcallaway merged commit 5597a86 into sigstore:main Nov 11, 2021
mtrmac pushed a commit to mtrmac/sigstore that referenced this pull request Mar 10, 2023
…#123)

Bumps [github.com/open-policy-agent/opa](https://github.com/open-policy-agent/opa) from 0.26.0 to 0.27.1.
- [Release notes](https://github.com/open-policy-agent/opa/releases)
- [Changelog](https://github.com/open-policy-agent/opa/blob/master/CHANGELOG.md)
- [Commits](open-policy-agent/opa@v0.26.0...v0.27.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants