Using HTTPS with JWT token. (With solution/fix) #3403
Unanswered
KlaasVortex
asked this question in
Q&A
Replies: 1 comment
-
If you need more control over the HTTP(S) request, I'd suggest directly using the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using HTTPS with JWT token.
I want to talk to Auth0 api to automaticly update user-data. There is an api, but only over https and you need JWT keys to access this.
First time here. So be patient. Not sure if this is the right place for this.
There is the class Poco::Net::HTTPSStreamFactory which can handle the HTTPS call.
I used this example to build the HTTPS client
The only issue is that you cannot use JWT-token with this class since the HTTPRequest is used as a local variable in the open()
And to be able to sent the JWT token I would have to req.set("Authorization", "Bearer " );`
So near the req.set("Accept", "/"); code in the open()
Original Poco code
So I have created a inherited class and made the HTTPRequest a private variable in the class and just copied the open function code and removed the local variable and renamed req to httpRequest.
This way I can access the HTTPRequest and use JWT token. This works fine.
I expect that there are more people using https + JWT-keys. So my question, is this function missing in Poco or am I doing it wrong ?
Beta Was this translation helpful? Give feedback.
All reactions