0

using .net C# 4.7. I would like know whats the best way to send JWT from my page to an external page?

Please let me know if i need include any libraries .

Any other suggestions or information on where to look is strongly appreaciated.

Thank You.

askjdasbd
  • 1
  • 1
  • Please provide more context information. There are a bunch of examples of how to use JWT Bearer Tokens, Would you like to send the token for authorization purpose or just for sharing? Which is btw not the purpose of JWT. – DTeuchert Jul 10 '23 at 21:07
  • i am pretty new to the whole JWT Bearer Tokens.If you know any simple examples? – askjdasbd Jul 10 '23 at 21:18
  • JWT Bearer Tokens are used for authorization purpose, [here](https://stackoverflow.com/a/40284152/5188233) is an detailed answer regarding JWT tokens. – DTeuchert Jul 11 '23 at 19:51

1 Answers1

0

It really depends on the size of the JWT and what you mean by "external page". If you are sending a bigger payload then a POST request works best because there are larger size limits. If it's small, it can go in the request query parameters via a GET request. Either way, a best practice is to encrypt the JWT so you are not leaking access tokens to the public. Assuming you have control over the external page, you can simply put a reference key in the query parameter so the JWT can be pulled from cache or a database. Keep in mind data at rest, like in a database, is also at risk so a good technique is to encrypt everything in case the database gets lost or stolen.

beautifulcoder
  • 10,832
  • 3
  • 19
  • 29
  • its a small payload ( Id, first , last name, phone number). By "external page" i mean Page developed by different group that resides on a different server. – askjdasbd Jul 10 '23 at 21:15