[jcifs] Question about userinfo encoding?

Michael B Allen ioplex at gmail.com
Thu Jul 14 19:29:56 MDT 2011


On Mon, Jul 11, 2011 at 2:16 PM, Sean Daley <spdaley at gmail.com> wrote:
> According to the SmbFile javadoc, the userinfo component of the SMB
> URL must be URL encoded but
> then it goes on to say that JCIFS will work correctly with anything
> but '@' and '%' encoded.  I first
> interpreted that to mean that when using JCIFS, I should only really
> need to worry about encoding '@'
> and '%'.  Unfortunately we then had a password with a '#' in it and
> the URL blew up.  When using
> JCIFS, should we make sure that we always URL encode the userinfo
> component?

Hi Sean,

Actually I don't recall what the rules are. That is because you should
not put credentials into the URL for a number of reasons and not just
because characters like # are reserved in URLs.

The correct way to specify credentials is with the
NtlmPasswordAuthentication class and then pass the NPA to SmbFile
constructors.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/


More information about the jCIFS mailing list