Closed faizol closed 2 years ago
Hi! Yes, it looks like the right way.
Hi,
Thanks for the reply. I can't seems to get to extract the Bearer token coz auth_params.has_value() always returns false. The auth Bearer was set and has value when I checked it using http Header Live addon on Firefox.
Any pointers on how should I proceed to get the Bearer token?
Thank you very much.
I don't use bearer auth by myself, tools for working with this type of auth were contributed by @prince-chrismc , maybe he can help here.
Anyway, try_parse_params
returns expected<params_t, extraction_error_t>
. If you can't get the params_t
then you can examine extraction_error_t
instance. Maybe it provides some useful information.
Thank you very much. I think I have found my problem. The token should be refreshed when navigating from one page to another as the token is not persistent, right? So if the previous page doesn't set the token in the header, then it won't be read by the next page. But I will contact @prince-chrismc to confirm what I mentioned above is the problem.
Another question. What's the best way to redirect a page to another page from within restinio? What I do now is to embed javascript in a body response.
Thank you again for your time, cheers.
I'll close this for now, thank you again.
What's the best way to redirect a page to another page from within restinio?
What do you mean under "redirect a page"? The use of HTTP Status Code 30x, like 301 "Moved Permanently"?
Some note how I implemented the client workflow,
a GET endpoint which sends the user to the "form submission"
All other endpoints use the code in https://github.com/Stiffstream/restinio/issues/152#issue-991363698
The token should be refreshed when navigating from one page to another as the token is not persistent, right? So if the previous page doesn't set the token in the header, then it won't be read by the next page
According to best practices, you should save the JWT securely in the application... which has a short expiration and you only need to refresh at the half life =)
Hi,
I'm trying to set jwt token but I'm not sure if the method below is the right way to get the token from the header.
I'm setting the token like this;
and trying to read it like this;
Is that the right way to get the token?
Thanks.