ESPv2 authentication error getting mapped to StatusCode.UNKNOWN
See original GitHub issueI have a gRPC endpoint that sits behind ESPv2 with JWT authentication configured and I’m trying to configure a retry policy that will retry requests when say an invalid / expired JWT is passed in the request.
I was expecting that a HTTP 401 response from ESPv2 would be mapped to StatusCode.UNAUTHENTICATED
but instead it gets mapped to StatusCode.UNKNOWN
.
Sample server response:
< HTTP/2 401
< date: Tue, 19 Jan 2021 06:54:03 GMT
< content-type: application/json
< content-length: 40
< strict-transport-security: max-age=15724800; includeSubDomains
< access-control-allow-origin: *
< access-control-allow-credentials: true
< access-control-allow-methods: PUT, HEAD, GET, POST, OPTIONS
< access-control-allow-headers: Authorization, X-User-Agent, X-Grpc-Web, Content-Type
<
{"code":401,"message":"Jwt is missing"}
This then gets mapped to:
{
code: StatusCode.UNKNOWN,
message: 'Unknown Content-type received.',
metadata: {},
}
Relevant code seems to be here: https://github.com/grpc/grpc-web/blob/master/javascript/net/grpc/web/grpcwebclientreadablestream.js#L154-L159
Is there a way to do this?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Extensible Service Proxy V2 startup options - OpenAPI
The Extensible Service Proxy V2 (ESPv2) is an Envoy-based proxy that enables Cloud Endpoints to provide API management features. To configure ESPv2, you...
Read more >grpc - Bountysource
... are giving an error: {code: StatusCode.UNKNOWN, message: 'Incomplete response'} ... ESPv2 authentication error getting mapped to StatusCode.UNKNOWN $ 0.
Read more >draft-ietf-mobileip-calhoun-tep-01.txt
Tunnel establishment requires authentication. The tunnel establishment messages use some of the authentication extensions defined by [17].
Read more >Performance analysis of Proxy based encrypted ... - DiVA Portal
namespace invokes the server methods (GET, POST, PUT) for an operation to be performed. ... Null authentication which was mandatory in ESP-v2.
Read more >Unknown when authenticating with Cloud Endpoints - Stack ...
I'm trying to add authentication to my Cloud Endpoints, but I can't get it to work. I'm using this blog as a guideline: ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@LiBa001 Thanks for pointing this out.
Haven’t found a solution to this one unfortunately (the other issue I had with the CORS config was unrelated to this one and I forgot to update this issue) – reopening this issue.
espv2 is envoy based. Assuming it is possible to control the config, you could use a local reply to rewrite the 401 to something that
grpc-web
will consume. This works.