Class ServeFromURLAvatarHandler

All Implemented Interfaces:
ExtensionPoint, Describable<AvatarHandler>, Serializable

public class ServeFromURLAvatarHandler extends AvatarHandler
Records the URL advertised by the provider as-is, so that each user's browser fetches the image directly from the provider.

As the image is fetched by the browser rather than by the controller, the URL must be reachable from every user's browser, and the provider's domain ends up in the img-src Content Security Policy directive.

See Also:
  • Constructor Details

    • ServeFromURLAvatarHandler

      @DataBoundConstructor public ServeFromURLAvatarHandler()
  • Method Details

    • handleAvatar

      public void handleAvatar(@NonNull OicSecurityRealm realm, @NonNull User user, @CheckForNull String avatarUrl) throws IOException
      Description copied from class: AvatarHandler
      Record, refresh or clear the avatar for user.

      Called on the login request thread, so implementations must return promptly: anything needing network IO must be handled asynchronously.

      Specified by:
      handleAvatar in class AvatarHandler
      Parameters:
      avatarUrl - the value of the provider's avatar claim, or null if it was not present.
      Throws:
      IOException