Uploaded image for project: 'PicketLink'
  1. PicketLink
  2. PLINK-792

Need to set default encoding for FormParserFactory in SPFormAuthenticationMechanism

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • BASE

      The default-encoding is not set for formParserFactory object*1*2 in SPFormAuthenticationMechanism.

      org.picketlink.identity.federation.bindings.wildfly.sp.SPFormAuthenticationMechanism
          public SPFormAuthenticationMechanism(FormParserFactory parserFactory, String name, String loginPage, String errorPage, ServletContext servletContext, PicketLinkType configuration, PicketLinkAuditHelper auditHelper) {
              super(parserFactory, name, loginPage, errorPage);
              this.servletContext = servletContext;
              this.configuration = configuration;
              this.spConfiguration = (SPType) configuration.getIdpOrSP();
              this.auditHelper = auditHelper;
              // we need to create a new formParserFactory to be able to process Multi-Part messages
              this.formParserFactory = FormParserFactory.builder(true).build();                            <- *1
              startPicketLink();
          }
      
      io.undertow.server.handlers.form.FormParserFactory
          public static Builder builder(boolean includeDefault) {
              Builder builder = new Builder();
              if (includeDefault) {
                  builder.addParsers(new FormEncodedDataDefinition(), new MultiPartParserDefinition());    <- *2
              }
              return builder;
          }
      
          public static class Builder {
      
              ...
      
              public FormParserFactory build() {
                  if(defaultCharset != null) {
                      for (ParserDefinition parser : parsers) {
                          parser.setDefaultEncoding(defaultCharset);
                      }
                  }
                  return new FormParserFactory(parsers);
              }
      
          }
      

              psilva@redhat.com Pedro Igor Craveiro
              rhn-support-tmiyargi Teresa Miyar Gil (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: