There is a web authentication service (A) and a web service with secret information (B). There is a web client that sends a POST request to server A with a login and password. In case of success, it receives a token that attaches to requests to service B. Service B reads the token, and in case of validity, gives the secret information to the web client.
Question: how to encrypt a token so that it cannot be faked by the web client? What kind of logic should be on services A and B, provided that they absolutely do not know about the existence of each other?