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

JWT authorization token too long #3

Open
SamdevQ opened this issue Oct 24, 2021 · 3 comments
Open

JWT authorization token too long #3

SamdevQ opened this issue Oct 24, 2021 · 3 comments

Comments

@SamdevQ
Copy link

SamdevQ commented Oct 24, 2021

I've gotten the server and client apps running but when I try to make a request, the JWT token which comes from the local server's /token endpoint is apparently too many characters (which doesn't make sense as it's a valid JWT token from what I can tell and just as many characters as it needs to be).

Specifically, I get an HTTP 400 error with this response:

{"code":"400","description":"prepareTransactionRequest.authorization: size must be between 0 and 1024, prepareTransactionRequest.authorization: must match \"^Bearer [A-Za-z0-9\\-_. ]{1,1024}$\"","category":"Constraint Violations"}

My request (managed by the client app) contains the Authorization header as I would expect.

authorization: Bearer eyJ...[token redacted]

The URL this is hitting is https://api.sandbox.overledger.io/v2/preparation/transaction. Is that perhaps wrong? Should I not be hitting overledger.io and instead pointing to something local?

The token and the "Bearer " prefix are in fact 1061 characters (37 over the apparent 1024 limit), but that's not avoidable if the token is to be used in its entirety.

@SamdevQ
Copy link
Author

SamdevQ commented Oct 26, 2021

One other note, if I use an old token, I get 401 with the message:

{"message":"The incoming token has expired"}

This is understandable, the token did likely expire, but it seems the token is being processed prior to the constraint check, which may not be desirable. When I use a new token, the same issue in the first post persists.

@lukerQuant
Copy link

Hi @SamdevQ , in a recent version we added validation on the token length. This validation was too short in a small number of cases. We have since x4ed this validation length and released this with 2.1.3 OVL. Please check again.

@SamdevQ
Copy link
Author

SamdevQ commented Nov 30, 2021

I'll try testing things out again, thanks! I got sidetracked from looking into this, it sounds like that should fix it though

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

3 participants
@lukerQuant @SamdevQ and others