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

Implement support for sending OIDC auth tokens with request #20

Merged
merged 1 commit into from
Dec 9, 2020

Conversation

acoulton
Copy link
Contributor

Reproduced the new README section here for ease

Adds support for OIDC token authentication for HTTP target tasks. Tokens will be issued and signed by the emulator's (insecure) private key. The emulator will accept, and issue tokens for, any ServiceAccountEmail provided by the client.

By default, the JWT iss (issuer) field is "http://cloud-tasks-emulator".

Optionally, the emulator can host an HTTP OIDC discovery endpoint. This allows your application to verify tokens at runtime with the full online flow.

To enable this, specify an issuer value at startup:

go run ./ -openid-issuer http://localhost:8980

With this flag:

  • JWTs will have an iss field of http://localhost:8980
  • The discovery document will be available at http://localhost:8980/.well-known/openid-configuration
  • The emulator's public key(s) (in JWK format) will be available at http://localhost:8980/jwks

The -openid-issuer URL can be any http://hostname:port value that your application code can route to. The endpoint listens on 0.0.0.0 for easy use in docker / k8s environments.

You can, of course, export the content of the /jwks url if you prefer to hardcode the public keys in your application.

@aertje
Copy link
Owner

aertje commented Dec 1, 2020

Thanks @acoulton ! I'm afraid I won't get to this until the weekend though!

@acoulton
Copy link
Contributor Author

acoulton commented Dec 1, 2020

No problem

@aertje
Copy link
Owner

aertje commented Dec 6, 2020

What a fantastic piece of work!

@acoulton
Copy link
Contributor Author

acoulton commented Dec 6, 2020

What a fantastic piece of work!

Thanks very much :) Did you mean to merge it?

@aertje
Copy link
Owner

aertje commented Dec 7, 2020

Just waiting for a colleague (with more go experience) to have a look too.

@acoulton
Copy link
Contributor Author

acoulton commented Dec 7, 2020

ah, no worries - thanks.

@aertje aertje merged commit 2dcb9d9 into aertje:master Dec 9, 2020
@acoulton acoulton deleted the feat-oidc-tokens branch December 9, 2020 10:19
@acoulton
Copy link
Contributor Author

acoulton commented Dec 9, 2020

Fab, thanks :)

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