using C# RabbitMQ.Client send/receive message from server with LDAP plug in enabled.

485 views
Skip to first unread message

Lei Wu

unread,
Feb 17, 2015, 5:21:21 PM2/17/15
to rabbitm...@googlegroups.com
hello,

I am new in RabbitMQ and still learning.

I have setup LDAP plug and able to login in with NT credential from management page. My question is how can we use NT credential consume queues in C# client?  We can't pass the password in creating ConnectionFactory class. 

If anyone has the code sample, that will be great.

Thanks,

Michael Klishin

unread,
Feb 17, 2015, 5:29:47 PM2/17/15
to rabbitm...@googlegroups.com, Lei Wu
On 18 February 2015 at 01:21:23, Lei Wu (car...@gmail.com) wrote:
> I have setup LDAP plug and able to login in with NT credential
> from management page. My question is how can we use NT credential
> consume queues in C# client? We can't pass the password in creating
> ConnectionFactory class.

That's how you provide credentials with the LDAP mechanism: by setting username and password
on ConnectionFactory.

You also  map what attributes RabbitMQ LDAP plugin should map provided
username and password to in the config.

See http://rabbitmq.com/ldap.html, it has a fairly detailed explanation and examples.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ

Michael Klishin

unread,
Feb 17, 2015, 5:30:13 PM2/17/15
to rabbitm...@googlegroups.com, Lei Wu
  On 18 February 2015 at 01:28:51, Michael Klishin (mkli...@pivotal.io) wrote:
> That's how you provide credentials with the LDAP mechanism:
> by setting username and password
> on ConnectionFactory.
>
> You also map what attributes RabbitMQ LDAP plugin should map
> provided
> username and password to in the config.

By the way, if you can sign into management UI with your LDAP-provided credentials,
this means you already have everything configured correctly. Now simply specify the credentials
on ConnectionFactory before creating a connection.

Michael Klishin

unread,
Feb 17, 2015, 5:38:11 PM2/17/15
to Lei Wu, rabbitm...@googlegroups.com
+rabbitmq-users — please CC the list. 

On 18 February 2015 at 01:36:20, Lei Wu (car...@gmail.com) wrote:
> For the user exists in internal database, I can use the following
> statement establish connection.
>
> var factory = new ConnectionFactory { HostName = localBus, UserName="RabbitGuest",
> Password ="RabbitGuest", VirtualHost = "/" };
>
>
> However, we can't put production service account password in
> initializing ConnectionFactory class.

Read it from an environment variable, or an encrypted file. I wasn't suggesting hardcoding the value
but it has to be provided on ConnectionFactory. That's how you specify credentials with the .NET client.
Reply all
Reply to author
Forward
0 new messages