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

Error "malformed sJWS: wrong number of '.' splitted elements" is occurred #164

Open
mystria opened this issue May 28, 2018 · 5 comments
Open

Comments

@mystria
Copy link

mystria commented May 28, 2018

I referred FAQ https://docs.apigee.com/api-platform/faq/edge-microgateway-faq#securityquestions-caniusemyownoauthtokenwithedgemicrogateway to turn off the built-in authorization.
But, there is an error occurred like,

"malformed sJWS: wrong number of '.' splitted elements"

when I posted curl like,

curl --user {username}:{password} -d "" -X POST http://127.0.0.1:8000/simple/token?grant_type=client

If I set "allowOAuthOnly: true", there is no error occurred, but it's not proper settings what I want.


This is my environment.
current nodejs version is v8.11.2
current edgemicro version is 2.5.16

@mystria
Copy link
Author

mystria commented May 30, 2018

I resolve the problem to remove 'oauth' from plugins configuration yaml:

edgemicro: 
   plugins:
     sequence:
       - oauth   <-- remove it

Anyway it works no more check 'Authorization' header.
Is it right way?

@srinandan
Copy link
Contributor

Helllo @mystria ,

There are two ways to turn off MG's authorization:

  1. set the properties you've identified to true, like you did
  2. remove the plugin from sequence, like you did

Are you not seeing a behavior you expect?

@hoda9801
Copy link

hoda9801 commented Nov 12, 2018

I'm having the same issue with getting the error "malformed sJWS: wrong number of '.' splitted elements". So, I removed the "- oauth" and now I'm getting the following error.

1542029569025 warn targetRequest error m=undefined, u=undefined, h=, r=:0, d=19, i=727140e0-e67f-11e8-b8f0-c13af9a923b0, name=Error, message=read ECONNRESET, code=ECONNRESET, stack=Error: read ECONNRESET
at TLSWrap.onread (net.js:622:25)
1542029569025 error m=POST, u=/oauth2/token, h=localhost:8000, r=::1:56350, s=502, name=Error, message=read ECONNRESET, code=ECONNRESET, stack=Error: read ECONNRESET
at TLSWrap.onread (net.js:622:25)

Any ideas on why I'm getting this error?

@anshul07
Copy link

@srinandan the behaviour has got changed since 2.4.6 as earlier when a malformed token was passed in the request, edgemicro used to respond with 401 but now it is 500 with a text response "malformed sJWS: wrong number of '.' splitted elements". If an invalid token is passed edgmicro should return 4XX error instead of 500, as 500 status code denotes that issue is at server side.

@hoda9801
Copy link

hoda9801 commented Nov 19, 2018

I'm having the same issue with getting the error "malformed sJWS: wrong number of '.' splitted elements". So, I removed the "- oauth" and now I'm getting the following error.

1542029569025 warn targetRequest error m=undefined, u=undefined, h=, r=:0, d=19, i=727140e0-e67f-11e8-b8f0-c13af9a923b0, name=Error, message=read ECONNRESET, code=ECONNRESET, stack=Error: read ECONNRESET
at TLSWrap.onread (net.js:622:25)
1542029569025 error m=POST, u=/oauth2/token, h=localhost:8000, r=::1:56350, s=502, name=Error, message=read ECONNRESET, code=ECONNRESET, stack=Error: read ECONNRESET
at TLSWrap.onread (net.js:622:25)

Any ideas on why I'm getting this error?

This turned out to be an issue with our internal network. So, it doesn't have anything to do with the microgateway.

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

4 participants