Menkot
Menkot

Reputation: 734

Hide parameter in url

When searching with email, the email will be showed in url. What‘s the better way to hide the email part? Use POST? Thank you.

URI: https://myproject/api/tenants/A1/[email protected]&page=1&pageSize=10

Service:

@GET
@Path("/tenants/{tenantsId}/users")
@Produces("application/json;charset-UTF-8")
public Response index(
@PathParam("tenantId") String tenantId, 
@DefaultValue("1") @QueryParam("page") int page,
@DefaultValue("10") @QueryParam("pageSize") int pageSize,
@QueryParam("email") string email) 
throw .....Exception;

Upvotes: 0

Views: 227

Answers (1)

Anton Krug
Anton Krug

Reputation: 1781

You could "encrypt" it with public/private keys so then on the server side you could decipher it and being part of URL wouldn't mean much as just leaving some ciphertext in the URL. Or use POST. Or use JWT https://jwt.io/

Upvotes: 1

Related Questions