Class SamlPostBindingMessage

java.lang.Object
com.revetsec.saml.SamlPostBindingMessage

@Immutable public final class SamlPostBindingMessage extends Object
An opaque untrusted SAML HTTP-POST message. Binding parsing is not XML parsing, signature validation, authentication, or permission to use RelayState as a redirect target. Retain the original form body and header multiplicity when calling fromFormBodyResult(byte[], List, String).
Since:
1.0.0
  • Method Details

    • fromFormBodyResult

      public static @NonNull SamlPostBindingParseResult fromFormBodyResult(byte @NonNull [] body, @NonNull List<@NonNull String> contentTypeValues, @Nullable String rawQuery)
      Decodes the original form body with strict UTF-8, multiplicity, MIME and Base64 checks. The decoded form value must be canonical padded standard Base64, allowing at most 4096 ASCII spaces, tabs, carriage returns or line feeds anywhere in that value. Padding is required for partial quanta and unused pad bits must be zero; URL-safe Base64 is rejected. Form decoding happens once: a literal Base64 plus must be percent-encoded as %2B.
      Parameters:
      body - original HTTP request body
      contentTypeValues - all Content-Type field values
      rawQuery - original query string, or null when absent
      Returns:
      a parsed untrusted message or a fixed rejection
      Since:
      1.0.0
    • fromLogoutFormBodyResult

      public static @NonNull SamlPostBindingParseResult fromLogoutFormBodyResult(byte @NonNull [] body, @NonNull List<@NonNull String> contentTypeValues, @Nullable String rawQuery)
      Decodes exactly one SAMLRequest or SAMLResponse and optional RelayState at a logout endpoint. XML and signatures remain unverified. The login factory continues to accept only SAMLResponse. Both message kinds use the same bounded canonical Base64 grammar as fromFormBodyResult(byte[], List, String).
      Parameters:
      body - original HTTP request body
      contentTypeValues - all Content-Type field values
      rawQuery - original query string, or null when absent
      Returns:
      a parsed untrusted logout message or a fixed rejection
      Since:
      1.0.0
    • getRelayState

      Returns the untrusted RelayState value without interpreting it as a URL.
      Returns:
      the opaque RelayState value, if present
      Since:
      1.0.0
    • getKind

      Returns the untrusted form-field kind.
      Returns:
      message kind
      Since:
      1.0.0
    • toString

      Redacts the decoded XML and RelayState. @since 1.0.0
      Overrides:
      toString in class Object