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

OpenID Configuration Discovery Endpoint #18535

Closed
wants to merge 5 commits into from
Closed

Conversation

schmichael
Copy link
Member

@schmichael schmichael commented Sep 19, 2023

WIP branch to test against AWS

Issuer (and JWKS base address) is configurable with oidc_issuer = "..." in your agent config.

Endpoint is at http://localhost:4646/.well-known/openid-configuration

Comment on lines 97 to 102
//FIXME(schmichael) should we bother implementing an RPC just to get region
//forwarding? I think *not* since consumers of this endpoint are code that is
//intended to be talking to a specific region directly.
if args.Region != conf.Region {
return nil, CodedError(400, "Region mismatch")
}
Copy link
Member

Choose a reason for hiding this comment

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

This is a HTTP endpoint, so clients expose it too, right? Don't we need RPC forwarding for that to work?

Copy link
Member Author

Choose a reason for hiding this comment

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

No because there's no RPC involved at all: any agent regardless of whether it's client or server can serve this request...

...but for operational simplicity I should probably make it an RPC and server-only. That way you only have to configure the issuer on your servers, and we can avoid having a situation where every agent in a cluster must have the exact same config value or risk breaking something.

@vercel

This comment was marked as outdated.

schmichael added a commit that referenced this pull request Oct 21, 2023
Added the [OIDC Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) `/.well-known/openid-configuration` endpoint to Nomad, but it is only enabled if the `server.oidc_issuer` parameter is set. Documented the parameter, but without a tutorial trying to actually _use_ this will be very hard.

I intentionally did *not* use https://github.com/hashicorp/cap for the OIDC configuration struct because it's built to be a *compliant* OIDC provider. Nomad is *not* trying to be compliant initially because compliance to the spec does not guarantee it will actually satisfy the requirements of third parties. I want to avoid the problem where in an attempt to be standards compliant we ship configuration parameters that lock us in to a certain behavior that we end up regretting. I want to add parameters and behaviors as there's a demonstrable need.

Users always have the escape hatch of providing their own OIDC configuration endpoint. Nomad just needs to know the Issuer so that the JWTs match the OIDC configuration. There's no reason the actual OIDC configuration JSON couldn't live in S3 and get served directly from there. Unlike JWKS the OIDC configuration should be static, or at least change very rarely.

This PR is just the endpoint extracted from #18535. The `RS256` algorithm still needs to be added in hopes of supporting third parties such as [AWS IAM OIDC Provider](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html).

Co-authored-by: Luiz Aoqui <[email protected]>
@schmichael
Copy link
Member Author

Replaced by #18882 and #18691

@schmichael schmichael closed this Jan 8, 2024
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.

2 participants