Token-based authentication
As we said earlier, when one service wants to get access to another without any user intervention, we can use a CCG flow. The idea behind CCG is that a service can connect to an authentication service and ask for a token that it can then use to authenticate against other services.
Authentication services could issue multiple tokens in systems where different sets of permissions are needed, or identities vary.
Tokens can hold any information that is useful for the authentication and authorization process. Some of these are as follows:
- The
username
orID
, if it's pertinent to the context - The scope, which indicates what the caller can do (
read
,write
, and so on) - A
timestamp
indicating when the token was issued - An expiration
timestamp
, indicating how long the token is valid for
A token is usually built as a complete proof that you have permission to use a service. It is complete because it is possible to validate...