Class OAuthStateContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.sp.oidc.context.OAuthStateContext
All Implemented Interfaces:
Iterable<org.opensaml.messaging.context.BaseContext>

public class OAuthStateContext extends org.opensaml.messaging.context.BaseContext
A context to store information pertaining to the OAuth2 state parameter.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

    org.opensaml.messaging.context.BaseContext.ContextSetNoRemoveIteratorDecorator, org.opensaml.messaging.context.BaseContext.DeprecatedContextClassNameLookAside
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    The OAuth 2.0 state string.
    private net.minidev.json.JSONObject
    Optionally the decoded state as a JSON object.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the raw OAuth 2.0 state string.
    net.minidev.json.JSONObject
    Gets the decoded OAuth 2.0 state as a JSON object.
    setState(String stateString)
    Sets the raw OAuth 2.0 state string.
    setStateJson(net.minidev.json.JSONObject jsonObject)
    Sets the decoded OAuth 2.0 state as a JSON object.

    Methods inherited from class org.opensaml.messaging.context.BaseContext

    addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParent

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Field Details

    • state

      @Nullable private String state
      The OAuth 2.0 state string.
    • stateJson

      @Nullable private net.minidev.json.JSONObject stateJson
      Optionally the decoded state as a JSON object.
  • Constructor Details

    • OAuthStateContext

      public OAuthStateContext()
  • Method Details

    • getState

      @Nullable public String getState()
      Gets the raw OAuth 2.0 state string.
      Returns:
      the state string, or null if not set
    • setState

      public OAuthStateContext setState(@Nullable String stateString)
      Sets the raw OAuth 2.0 state string.
      Parameters:
      stateString - the state string to set
      Returns:
      this context instance
    • getStateJson

      @Nullable public net.minidev.json.JSONObject getStateJson()
      Gets the decoded OAuth 2.0 state as a JSON object.
      Returns:
      the JSON object, or null if not set
    • setStateJson

      public OAuthStateContext setStateJson(@Nullable net.minidev.json.JSONObject jsonObject)
      Sets the decoded OAuth 2.0 state as a JSON object.
      Parameters:
      jsonObject - the JSON object to set
      Returns:
      this context instance