The state_id parameter in the STSUniversalUser
module is used as a key to store or retrieve state information for
each invocation of the trust chain of an OAuth flow.
Advance Access Control provides sample mapping rules. These sample mapping rules use state
management API and are applicable to OAuth 2.0 protocols. We can get the
sample mapping rules from the File downloads
section.
OAuth 2.0
OAuth 2.0 tokens, such as grants,
access tokens, and refresh tokens, have a state_id parameter
used in Security Token Service mapping rules. The state_id parameter
maintains state between associated Security Token Service calls in
an OAuth 2.0 flow.
The OAuth 2.0 mapping rule uses the state_id as
the key to issue an authorization grant. The key is used to add the
token storage time to a cache. The storage time is then retrieved
from the cache during a request for a protected resource.
Figure 1 shows a section of the
sample JavaScript mapping
rule for OAuth 2.0.