Class UserMessageExtension

java.lang.Object
se.swedenconnect.spring.saml.idp.extensions.UserMessageExtension
All Implemented Interfaces:
Serializable

public class UserMessageExtension extends Object implements Serializable
Representation of a UserMessage, see User Message Extension in SAML Authentication Requests.
Author:
Martin Lindström
See Also:
  • Field Details

    • NO_LANG

      public static final String NO_LANG
      Symbolic constant used to specify that no language was given.
      See Also:
  • Constructor Details

    • UserMessageExtension

      public UserMessageExtension(@NonNull se.swedenconnect.opensaml.sweid.saml2.authn.umsg.UserMessage userMessage) throws InvalidMimeTypeException
      Constructor.
      Parameters:
      userMessage - a UserMessage object
      Throws:
      InvalidMimeTypeException - if the supplied MIME type is invalid
  • Method Details

    • getMimeType

      @NonNull public MimeType getMimeType()
      Gets the MIME type for the messages.
      Returns:
      the MIME type
    • getMessages

      @NonNull public Map<String,String> getMessages()
      Gets the messages contained within the UserMessage extension.

      Each entry of the returned Map holds the language code as the key and the Base64 encoded message as the value. Note "NO_LANG" will be used as key if no language was specified.

      Returns:
      a Map of language codes and Base64 encoded messages
    • getProcessedMessages

      @Nullable public Map<String,String> getProcessedMessages()
      Gets the processed messages. If a UserMessagePreprocessor is installed, the processedMessages will contain the result from this processing, i.e., strings that are prepared for display (on a web page, on a device, ...).
      Returns:
      messages ready for displaying, or null if the messages haven't been processed
    • setProcessedMessages

      public void setProcessedMessages(@NonNull Map<String,String> processedMessages)
      Assigns the processed messages. If a UserMessagePreprocessor is installed, the processedMessages will contain the result from this processing, i.e., strings that are prepared for display (on a web page, on a device, ...).
      Parameters:
      processedMessages - processed messages