Special Characters in SECURITY_PRINCIPAL

View: New views
2 Messages — Rating Filter:   Alert me  

Special Characters in SECURITY_PRINCIPAL

by Avneet Singh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello
 
I am having problem getting the DirContext if security principal has a comma as a special character.
 
        env.put(Context.INITIAL_CONTEXT_FACTORY, getProperty(INITIAL_CONTEXT_FACTORY));
        env.put(Context.PROVIDER_URL, getProperty(PROVIDER_URL));
        env.put(Context.SECURITY_PRINCIPAL, principal);
        env.put(Context.SECURITY_CREDENTIALS, credentials);
        env.put(Context.SECURITY_AUTHENTICATION, getProperty(SECURITY_AUTHENTICATION));
        ctx = (DirContext) new com.sun.jndi.ldap.LdapCtxFactory ().getInitialContext(env);
'ctx' comes null in the above code.
I have tried escaping the comma with it with /, and also with //, but nothing helps.
 
Could not find any info on net also.. Can someone pl comment.

--
Regds
Avneet Singh
=========================================================================== To unsubscribe, send email to listserv@... and include in the body of the message "signoff JNDI-INTEREST". For general help, send email to listserv@... and include in the body of the message "help".

Re: Special Characters in SECURITY_PRINCIPAL

by Sean Morris-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think it should be :  \,



Avneet Singh wrote:

> Hello
>
> I am having problem getting the DirContext if security principal has a
> comma as a special character.
>
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
> getProperty(INITIAL_CONTEXT_FACTORY));
>         env.put(Context.PROVIDER_URL, getProperty(PROVIDER_URL));
>         env.put(Context.SECURITY_PRINCIPAL, principal);
>         env.put(Context.SECURITY_CREDENTIALS, credentials);
>         env.put(Context.SECURITY_AUTHENTICATION,
> getProperty(SECURITY_AUTHENTICATION));
>         ctx = (DirContext) new com.sun.jndi.ldap.LdapCtxFactory
> ().getInitialContext(env);
> 'ctx' comes null in the above code.
> I have tried escaping the comma with it with /, and also with //, but
> nothing helps.
>
> Could not find any info on net also.. Can someone pl comment.
>
> --
> Regds
> Avneet Singh
> ===========================================================================
> To unsubscribe, send email to listserv@... and include in the
> body of the message "signoff JNDI-INTEREST". For general help, send
> email to listserv@... and include in the body of the message
> "help".

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JNDI-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".