question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AuthModule : adding headers before authentication

See original GitHub issue

As a solution to https://github.com/datawire/ambassador/issues/216, we decided to add a routing service between our many auth services. The idea was to route the request depending on a http header which ambassador would add depending on the AuthService configuration.

Sadly, add_request_headers or envoy_override are not available in the AuthService schema. This can be done at the Mapping level since it’s passed the authentication.

Describe the solution you’d like

---
apiVersion: ambassador/v0
kind:  AuthService
name:  auth-router
auth_service: some-auth-service
add_request_headers:
- name: x-some-auth-header
  value: some-value

Describe alternatives you’ve considered

The envoy_override could be a more advanced option.

---
apiVersion: ambassador/v0
kind:  AuthService
name:  auth-router
auth_service: some-auth-service
envoy_override:
  request_headers_to_add:
  - append: true
    header: 
      key: x-some-auth-header
      value: some-value

Third option

If a Mapping define the add_request_headers options, maybe add those headers to the authentication automatically.

Work around

In the end we used the host/:authority to route our traffic, but the solution would have been much more elegant if the routing could be determined through the service’s annotation instead of hardcoding it in the authentication routing proxy.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
richarddlicommented, Apr 18, 2019

Why not just deploy the AuthService as a sidecar?

0reactions
stale[bot]commented, Jun 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AuthModule : adding headers before authentication · Issue #921
As a solution to #216, we decided to add a routing service between our many auth services. The idea was to route the...
Read more >
passing up headers from auth_request - nginx - Server Fault
When the response is sent, headers set by auth-module should be kept and sent to the client. I think I didn't understand properly...
Read more >
The Auth Module - Kamailio SIP Server
The following modules must be loaded before this module: sl - stateless reply. ... Should an Authentication-Info header be added on 200 OK...
Read more >
angularjs resource Authentication Header based on request ...
This config i think contains the headers property that you can update before making the request. Here is the signature for PUT.
Read more >
The Complete Guide to Angular User Authentication with Auth0
Learn how to add user authentication to Angular using Observables and ... Then, add AuthModule to the AppModule imports and initialize it:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found