Add Endpoint() api call to oidc.Provider#139
Conversation
jimlambrt
left a comment
There was a problem hiding this comment.
Ty for the PR. Next, perhaps consider opening an issue first where we can discuss the proposed feature/change and get alignment on how to proceed?
With that said, adding this seems reasonable as long as the contribution covers all the necessary changes and not just a one-off additional provider func to dig out the oauth2.Endpoint if the provider returned it in its discovery reponse. To that end I have a few comments/questions/suggestions:
- How would this work if the provider doesn't support discovery and is configured via the
WithProviderConfig(...)option? - I think, we need a solution that supports both discovery and the
WithProviderConfigoption. If we do that we can likely return a copy of the provider'soidc.ProviderConfighere which makes it consistent with the current implementation which wraps the underlying oauth2.Endpoint with it's own type. - We need unit tests for all changes, so we need to add support for the device AuthURL to the oidc.TestProvider
|
Thanks for the quick response. I had started to add a DeviceAuthURL field to ProviderConfig and to DiscoveryInfo but it appeared to be opening a big can of worms so I thought I would try first just this most simple of changes, especially since that was exactly what I needed and I don't have any idea if anyone else would use the other changes. Next I will try to do what you ask. |
3dfe47b to
18be49c
Compare
|
Replaced by #140 |
This adds an
Endpoint()api call tooidc.Providerwhich simply invokes the underlying coreos/go-oidcEndpoint()api. That returns anoauth2.Endpointobject which since coreos/go-oidc#365 includes theDeviceAuthURLin addition to theAuthURLandTokenURLvalues read by oidc discovery. This enables simplifying applications that need to use those URLs and avoids them having to separately discover that information, for example hashicorp/vault-plugin-auth-jwt#131 which adds the device flow to jwt/oidc authentication.