Interface OAuthIdentityTokenStrategy

All Superinterfaces:
org.eclipse.lyo.server.oauth.core.token.TokenStrategy
All Known Implementing Classes:
ClusterableTokenStrategy

public interface OAuthIdentityTokenStrategy extends org.eclipse.lyo.server.oauth.core.token.TokenStrategy
A TokenStrategy that is aware of the OAuthIdentity of the authorizing user.
Since:
3.3.0
  • Method Details

    • getOAuthIdentity

      OAuthIdentity getOAuthIdentity(String oauthToken)
      Gets the OAuthIdentity associated with an access/request token. Implementations must catch (and cache) this identity during the OAuth dance.
      Parameters:
      oauthToken - the access or request token key.
      Returns:
      the associated identity if found, null otherwise.
    • setTwoLeggedOAuthIdentity

      void setTwoLeggedOAuthIdentity(String consumerKey, OAuthIdentity identity)
      Convenient method to associate an OAuthIdentity with a consumer after a two-legged authentication. Since no end-user is involved in two-legged authentication requests, this method allows associating the consumer with the OAuthIdentity of the corresponding functional user once is resolved; subsequent requests can call then the getTwoLeggedOAuthIdentity(String) method to get the OAuthIdentity of the consumer without having to resolve it again.
      Parameters:
      consumerKey - the consumer key.
      identity - the identity of the consumer's functional user.
    • getTwoLeggedOAuthIdentity

      OAuthIdentity getTwoLeggedOAuthIdentity(String consumerKey)
      Gets the OAuthIdentity mapped to a consumer key by the setTwoLeggedOAuthIdentity(String, OAuthIdentity) method. This method will retrieve the identity until the removeTwoLeggedOAuthIdentity(String) method is called or the map entry expires in the particular cache implementation.
      Parameters:
      consumerKey - the consumer key.
      Returns:
      the corresponding OAuthIdentity if mapped; null otherwise.
    • removeTwoLeggedOAuthIdentity

      void removeTwoLeggedOAuthIdentity(String consumerKey)
      Removes the OAuthIdentity mapped to a consumer key by the setTwoLeggedOAuthIdentity(String, OAuthIdentity) method.
      Parameters:
      consumerKey - the consumer key.