Class SessionUtils

java.lang.Object
com.inrupt.client.spring.SessionUtils

public final class SessionUtils extends Object
A utility class for converting Spring constructs into session objects for use with the Java Client libraries.
  • Method Details

    • asSession

      public static Optional<Session> asSession(org.springframework.security.oauth2.core.user.OAuth2User user)
      Convert a Spring OAuth2User to a Session object.

      This method uses the OpenIdSession library to create a Session

      Parameters:
      user - the Spring user object
      Returns:
      the session, if present and unexpired
    • asSession

      public static Optional<Session> asSession(org.springframework.security.oauth2.core.user.OAuth2User user, Function<String,Session> mapping)
      Convert a Spring OAuth2User to a Session object.
      Parameters:
      user - the Spring user object
      mapping - a mapping function for creating a Session from an ID token
      Returns:
      the session, if present and unexpired