Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Microgateway not working with OAuth

Experimenting with Micro Gateway on my MacOS 10.12.6 device. Was able to configure and get it working without OAuth. When I try to enable OAuth with API Key. I get a 401 Unauthorized invalid token:

curl -i http://localhost:8000/edgemicro_steve_proxy/ -H "x-api-key: redacted" HTTP/1.1 401 Unauthorized content-type: application/json Date: Thu, 05 Oct 2017 12:31:05 GMT Connection: keep-alive Content-Length: 25 Proxy-Connection: keep-alive {"error":"invalid_token"}

I have 2 colleague with Micro gateway installed and same API key is successful on those 2 micro gateways. I've verified/copied their config yaml but still get invalid token.

Debug log shows this:

LIBP45P-16591WL:~ n0001010$ DEBUG=* /Users/n0001010/Downloads/microgateway257/node_modules/edgemicro/cli/edgemicro start -o internal -e sandbox -k redacted-s redacted -c /Users/n0001010/.edgemicro current nodejs version is v6.11.3 current edgemicro version is 2.5.7 apigee Operating without access to apigee-access +0ms info: jwk_public_keys download from null returned 200 undefined info: jwt_public_key download from https://sandbox.api.npx.lmig.com/edgemicro-auth/publicKey returned 200 OK info: products download from https://sandbox.api.npx.lmig.com/edgemicro-auth/products returned 200 OK info: config download from https://sandbox.api.npx.lmig.com/edgemicro/bootstrap/organization/internal/environment/sandbox returned 200 OKconnection': 'Keep-Alive', 'x-api-key': 'Ronbx6MFg6v7wHCDNvrBrYuZI49Xlw7U', connection: 'keep-alive', client_received_start_timestamp: 1507207864134 } GET /edgemicro_steve_proxy/ +0ms gateway:errors invalid_token +207ms

Here is the version:

LIBP45P-16591WL:~ n0001010$ DEBUG=* /Users/n0001010/Downloads/microgateway257/node_modules/edgemicro/cli/edgemicro start -o internal -e sandbox -k ea891fc9448d0ea505f126ed3a9d08ec6674b5c17384c756f1d8b6f7bd0d142e -s d31ba02320ad429d75c106efc61d304866ec144d504c5776decdc70f7b291de2 -c /Users/n0001010/.edgemicro current nodejs version is v6.11.3 current edgemicro version is 2.5.7 apigee Operating without access to apigee-access +0ms info: jwk_public_keys download from null returned 200 undefined info: jwt_public_key download from https://sandbox.api.npx.lmig.com/edgemicro-auth/publicKey returned 200 OK info: products download from https://sandbox.api.npx.lmig.com/edgemicro-auth/products returned 200 OK info: config download from https://sandbox.api.npx.lmig.com/edgemicro/bootstrap/organization/internal/environment/sandbox returned 200 OK

My collegues are running node version 8.5.X . I did try that version but still get same error.

Thanks for any insights on what the issue may be.

0 2 1,738
2 REPLIES 2