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

Log JWT token in headers returned from AWS Cognito #76

Open
jeremych1000 opened this issue Jul 28, 2020 · 1 comment
Open

Log JWT token in headers returned from AWS Cognito #76

jeremych1000 opened this issue Jul 28, 2020 · 1 comment

Comments

@jeremych1000
Copy link

jeremych1000 commented Jul 28, 2020

Hello,

I've been using this signing proxy in our workflow successfully, which looks something like this:
AWS ALB --> SAML authentication via AWS Cognito --> aws-es-proxy --> AWS ElasticSearch / Kibana

I wish to log exactly who has made the request.

Therefore, I've turned on verbose logging, but want to access the headers of the request, especially X-Amzn-Oidc-Data [1], as this is a JWT token that includes information from the person that issued the request, i.e. name, email, etc. in the JWT payload.

From [1],

The JWT payload is a JSON object that contains the user claims received from the IdP user info endpoint.

{
   "sub": "1234567890",
   "name": "name",
   "email": "alias@example.com",
   ...
}

Is this possible to do in this proxy, given you already read the headers here?
https://github.com/abutaha/aws-es-proxy/blob/master/aws-es-proxy.go#L284

[1] https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-authenticate-users.html#user-claims-encoding

Thanks :)

@jeremych1000
Copy link
Author

I've merged a PR in our fork which enables this, but it's a custom solution for our problem and set up (ALB with Cognito integration). It works well.

Any ideas on how I can make the PR generic so it can be merged in this repo?

master...OakNorthAI:master

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

No branches or pull requests

1 participant