phax / as2-lib

A generic Java AS2 library, servlet and server
107 stars 43 forks source link

Basic authentication in as2-lb latest version #122

Closed punithdj closed 2 years ago

punithdj commented 3 years ago

Hi Philip,

Is HTTP basic authentication supported in as2-lib latest version ? I didn't find an option to add username/password to as2ClientSettings or AS2ClientRequest object.

phax commented 3 years ago

Hi @punithdj, this can simply be achieved by providing a custom HTTP Header. See https://datatracker.ietf.org/doc/html/rfc7617 for the full spec. Name of the header: Authorization and the value is Basic "+ base64(username + ":" + password)

Just add it to AS2ClientSetting.customHeaders ()

hth, Philip