You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Alaa Zubaidi <al...@pdf.com> on 2010/11/13 02:07:33 UTC

using SimpleAuthenticator is not working

using SimpleAuthenticator is not working with me in beta 3

I am doing the following:

·In Cassandra.yaml Set
authenticator: org.apache.cassandra.auth.SimpleAuthenticator
·Add username and password to passwd.proprties
·Add username to keyspace and column family permission in access.proprties
·Add the path for passwd.proprties and access.proprties to Cassandra.bat
set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
-Dpasswd.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3\conf\passwd.properties 

-Daccess.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3\conf\access.properties 


·Use login() to login to Cassandra in the application:
Map<String, String> creds = new HashMap<String, String>();
creds.put("user1", "pwd1");
AuthenticationRequest Auth = newAuthenticationRequest(creds);
_client.login(Auth);

its giving me an error, with no message, and if I try to do any thing 
its giving me "I am not logged in" error.
Is there any thing I am missing?


Thanks,
-- 
Alaa Zubaidi

Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
No, the sever is not logging anything


On 11/13/2010 4:27 PM, Stu Hood wrote:
> Is the server logging anything during the failed authentication?
>
>
> On Fri, Nov 12, 2010 at 8:07 PM, Alaa Zubaidi<al...@pdf.com>  wrote:
>
>>   using SimpleAuthenticator is not working with me in beta 3
>>
>> I am doing the following:
>>
>> ·         In Cassandra.yaml Set
>> authenticator: org.apache.cassandra.auth.SimpleAuthenticator
>> ·         Add username and password to passwd.proprties
>> ·         Add username to keyspace and column family permission in
>> access.proprties
>> ·         Add the path for passwd.proprties and access.proprties to
>> Cassandra.bat
>> set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
>>
>> -Dpasswd.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3\conf\passwd.properties
>>
>> -Daccess.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3\conf\access.properties
>>
>> ·         Use login() to login to Cassandra in the application:
>> Map<String, String>  creds = new HashMap<String, String>();
>> creds.put("user1", "pwd1");
>> AuthenticationRequest Auth = new  AuthenticationRequest(creds);
>> _client.login(Auth);
>>
>> its giving me an error, with no message, and if I try to do any thing its
>> giving me "I am not logged in" error.
>> Is there any thing I am missing?
>>
>>
>> Thanks,
>> --
>> Alaa Zubaidi
>>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Stu Hood <st...@gmail.com>.
Is the server logging anything during the failed authentication?


On Fri, Nov 12, 2010 at 8:07 PM, Alaa Zubaidi <al...@pdf.com> wrote:

>  using SimpleAuthenticator is not working with me in beta 3
>
> I am doing the following:
>
> ·         In Cassandra.yaml Set
> authenticator: org.apache.cassandra.auth.SimpleAuthenticator
> ·         Add username and password to passwd.proprties
> ·         Add username to keyspace and column family permission in
> access.proprties
> ·         Add the path for passwd.proprties and access.proprties to
> Cassandra.bat
> set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
>
> -Dpasswd.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3\conf\passwd.properties
>
> -Daccess.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3\conf\access.properties
>
> ·         Use login() to login to Cassandra in the application:
> Map<String, String> creds = new HashMap<String, String>();
> creds.put("user1", "pwd1");
> AuthenticationRequest Auth = new  AuthenticationRequest(creds);
> _client.login(Auth);
>
> its giving me an error, with no message, and if I try to do any thing its
> giving me "I am not logged in" error.
> Is there any thing I am missing?
>
>
> Thanks,
> --
> Alaa Zubaidi
>

Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
Thanks, its working now...

On 11/18/2010 1:50 PM, Nick Bailey wrote:
> I believe the map of credentials should be
>
> creds.put("username", "your_username");
> creds.put("password", "your_password");
>
> So you have two entries in the map, one for user and one for password. No
> idea why that call would be hanging though.
>
> On Thu, Nov 18, 2010 at 1:46 PM, Alaa Zubaidi<al...@pdf.com>  wrote:
>
>> Hi Aaron,
>> Thanks for the help..
>> If I don't use the Authenticator, and keep it at AllowAll it will work
>> find..
>> I tried provide an invalid password but it behaved the same...
>>
>> Here is what i am doing:
>>
>>         Map<String, String>  creds = new HashMap<String, String>();
>>         creds.put("username", "pwd");
>>
>>         AuthenticationRequest Auth = new  AuthenticationRequest(creds);
>>
>>         _logger.info("In ConnectCreateCassandraSchema");
>>
>>         _client.login(Auth);
>>
>>         _logger.info("after login " + _keyspace);
>>         _client.set_keyspace(_keyspace);
>>
>> It hangs in _client.login(Auth); and when I try to trap the error (no error
>> message), and if I let it continue it will give me "you are not logged in"
>>   on batch_mutate()
>>
>> Alaa
>>
>>
>>
>> On 11/18/2010 3:33 AM, aaron morton wrote:
>>
>>> I *think* that message is just from when the connection is closed.
>>>
>>> Sorry this is a hard one to help with, as it's more than likely something
>>> to do with your client app.
>>> Some guessing...
>>>
>>> Everything is working if you do not use the authenticator ?
>>> Can you inspect the ports on the server and see if the connection is
>>> created from the client ?
>>> Any difference if you use an invalid password ?
>>> Try using Hector ?
>>> Try creating a new testing app from scratch.
>>>
>>> Hope that helps
>>> Aaron
>>>
>>> On 18 Nov 2010, at 10:03, Alaa Zubaidi wrote:
>>>
>>>   One other thing, while login() hangs when called on the server side, and
>>>> nothing is logged, I see the following logged when I kill the hanged
>>>> process.
>>>>
>>>> DEBUG 13:01:10,640 logged out: null
>>>>
>>>> Thanks
>>>>
>>>> On 11/17/2010 12:41 PM, Alaa Zubaidi wrote:
>>>>
>>>>> Hi Aaron,
>>>>>
>>>>> I used the client, and was able to login.
>>>>> E:\cassandra>bin\cassandra-cli.bat -host 191.111.1.11 -port 9160
>>>>> Starting Cassandra Client
>>>>> Connected to: "Test Cluster" on 191.111.1.11/9160
>>>>> Welcome to cassandra CLI.
>>>>>
>>>>> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
>>>>> [default@unknown] use Realtime al 'al'
>>>>> Authenticated to keyspace: Realtime
>>>>> [alaa@Realtime]
>>>>>
>>>>> and here is whats logged sever side:
>>>>> DEBUG 12:38:04,921 logged in: #<User al groups=[]>
>>>>>
>>>>> I am using Java/thrift on windows.
>>>>>
>>>>> Regards,
>>>>> Alaa
>>>>>
>>>>> On 11/15/2010 5:37 PM, Aaron Morton wrote:
>>>>>
>>>>>> Can you try using the command line cassandra-cli tool ? fire it up and
>>>>>> look at
>>>>>> the online help, if you pass a user name and password to the "use"
>>>>>> statement it
>>>>>> will perform a login after setting the keyspace for the connection.
>>>>>>
>>>>>> Try testing the login that way, and see what is logged server side
>>>>>> (with logging
>>>>>> at DEBUG).
>>>>>>
>>>>>> Also, what client are you using ?
>>>>>>
>>>>>> Aaron
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi<al...@pdf.com>
>>>>>> wrote:
>>>>>>
>>>>>>    I removed the exception handling and It seems that the login() is
>>>>>>> hanging?
>>>>>>>
>>>>>>>   On 11/15/2010 1:36 PM, Eric Evans wrote:
>>>>>>>
>>>>>>>>   On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>>>>>>>>
>>>>>>>>>   I set authority to SimpleAuthority and
>>>>>>>>> log4j.rootLogger=DEBUG,stdout,R
>>>>>>>>>
>>>>>>>>>   and its still the same, the error in my application is
>>>>>>>>>   $batch_mutate_result.read(Cassandra.java:16477)
>>>>>>>>>   InvalidRequestException(why: you have not logged in)
>>>>>>>>>
>>>>>>>>>   and in the system.log after DEBUG ...... Disseminating load info...
>>>>>>>>>   DEBUG ...... batch_mutate
>>>>>>>>>
>>>>>>>>>   There is no mention to the login() and set_keyspace() methods.
>>>>>>>>>   and no other information..
>>>>>>>>>
>>>>>>>>   The login() method will either raise an AuthenticationException in
>>>>>>>> the
>>>>>>>>   client application if the login failed, or log something like
>>>>>>>> "logged
>>>>>>>>   in: #<User username groups=groupname>" if it succeeded.
>>>>>>>>
>>>>>>>>   Either you're not actually calling login(), or your code is trapping
>>>>>>>> the
>>>>>>>>   exception and obscuring the failure.
>>>>>>>>
>>>>>>>>
>>>>>>>>    -->    Alaa Zubaidi
>>>>>>>   PDF Solutions, Inc.
>>>>>>>   333 West San Carlos Street, Suite 700
>>>>>>>   San Jose, CA 95110 USA
>>>>>>>   Tel: 408-283-5639 (or 408-280-7900 x5639)
>>>>>>>   fax: 408-938-6479
>>>>>>>   email: alaa.zubaidi@pdf.com
>>>>>>>
>>>>>>>
>>>>>>>   --
>>>> Alaa Zubaidi
>>>> PDF Solutions, Inc.
>>>> 333 West San Carlos Street, Suite 700
>>>> San Jose, CA 95110  USA
>>>> Tel: 408-283-5639 (or 408-280-7900 x5639)
>>>> fax: 408-938-6479
>>>> email: alaa.zubaidi@pdf.com
>>>>
>>>>
>>>>
>>>
>> --
>> Alaa Zubaidi
>> PDF Solutions, Inc.
>> 333 West San Carlos Street, Suite 700
>> San Jose, CA 95110  USA
>> Tel: 408-283-5639 (or 408-280-7900 x5639)
>> fax: 408-938-6479
>> email: alaa.zubaidi@pdf.com
>>
>>
>>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Nick Bailey <ni...@riptano.com>.
I believe the map of credentials should be

creds.put("username", "your_username");
creds.put("password", "your_password");

So you have two entries in the map, one for user and one for password. No
idea why that call would be hanging though.

On Thu, Nov 18, 2010 at 1:46 PM, Alaa Zubaidi <al...@pdf.com> wrote:

> Hi Aaron,
> Thanks for the help..
> If I don't use the Authenticator, and keep it at AllowAll it will work
> find..
> I tried provide an invalid password but it behaved the same...
>
> Here is what i am doing:
>
>        Map<String, String> creds = new HashMap<String, String>();
>        creds.put("username", "pwd");
>
>        AuthenticationRequest Auth = new  AuthenticationRequest(creds);
>
>        _logger.info("In ConnectCreateCassandraSchema");
>
>        _client.login(Auth);
>
>        _logger.info("after login " + _keyspace);
>        _client.set_keyspace(_keyspace);
>
> It hangs in _client.login(Auth); and when I try to trap the error (no error
> message), and if I let it continue it will give me "you are not logged in"
>  on batch_mutate()
>
> Alaa
>
>
>
> On 11/18/2010 3:33 AM, aaron morton wrote:
>
>> I *think* that message is just from when the connection is closed.
>>
>> Sorry this is a hard one to help with, as it's more than likely something
>> to do with your client app.
>> Some guessing...
>>
>> Everything is working if you do not use the authenticator ?
>> Can you inspect the ports on the server and see if the connection is
>> created from the client ?
>> Any difference if you use an invalid password ?
>> Try using Hector ?
>> Try creating a new testing app from scratch.
>>
>> Hope that helps
>> Aaron
>>
>> On 18 Nov 2010, at 10:03, Alaa Zubaidi wrote:
>>
>>  One other thing, while login() hangs when called on the server side, and
>>> nothing is logged, I see the following logged when I kill the hanged
>>> process.
>>>
>>> DEBUG 13:01:10,640 logged out: null
>>>
>>> Thanks
>>>
>>> On 11/17/2010 12:41 PM, Alaa Zubaidi wrote:
>>>
>>>> Hi Aaron,
>>>>
>>>> I used the client, and was able to login.
>>>> E:\cassandra>bin\cassandra-cli.bat -host 191.111.1.11 -port 9160
>>>> Starting Cassandra Client
>>>> Connected to: "Test Cluster" on 191.111.1.11/9160
>>>> Welcome to cassandra CLI.
>>>>
>>>> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
>>>> [default@unknown] use Realtime al 'al'
>>>> Authenticated to keyspace: Realtime
>>>> [alaa@Realtime]
>>>>
>>>> and here is whats logged sever side:
>>>> DEBUG 12:38:04,921 logged in: #<User al groups=[]>
>>>>
>>>> I am using Java/thrift on windows.
>>>>
>>>> Regards,
>>>> Alaa
>>>>
>>>> On 11/15/2010 5:37 PM, Aaron Morton wrote:
>>>>
>>>>> Can you try using the command line cassandra-cli tool ? fire it up and
>>>>> look at
>>>>> the online help, if you pass a user name and password to the "use"
>>>>> statement it
>>>>> will perform a login after setting the keyspace for the connection.
>>>>>
>>>>> Try testing the login that way, and see what is logged server side
>>>>> (with logging
>>>>> at DEBUG).
>>>>>
>>>>> Also, what client are you using ?
>>>>>
>>>>> Aaron
>>>>>
>>>>>
>>>>>
>>>>> On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi<al...@pdf.com>
>>>>> wrote:
>>>>>
>>>>>   I removed the exception handling and It seems that the login() is
>>>>>> hanging?
>>>>>>
>>>>>>  On 11/15/2010 1:36 PM, Eric Evans wrote:
>>>>>>
>>>>>>>  On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>>>>>>>
>>>>>>>>  I set authority to SimpleAuthority and
>>>>>>>> log4j.rootLogger=DEBUG,stdout,R
>>>>>>>>
>>>>>>>>  and its still the same, the error in my application is
>>>>>>>>  $batch_mutate_result.read(Cassandra.java:16477)
>>>>>>>>  InvalidRequestException(why: you have not logged in)
>>>>>>>>
>>>>>>>>  and in the system.log after DEBUG ...... Disseminating load info...
>>>>>>>>  DEBUG ...... batch_mutate
>>>>>>>>
>>>>>>>>  There is no mention to the login() and set_keyspace() methods.
>>>>>>>>  and no other information..
>>>>>>>>
>>>>>>>  The login() method will either raise an AuthenticationException in
>>>>>>> the
>>>>>>>  client application if the login failed, or log something like
>>>>>>> "logged
>>>>>>>  in: #<User username groups=groupname>" if it succeeded.
>>>>>>>
>>>>>>>  Either you're not actually calling login(), or your code is trapping
>>>>>>> the
>>>>>>>  exception and obscuring the failure.
>>>>>>>
>>>>>>>
>>>>>>>   -- >   Alaa Zubaidi
>>>>>>  PDF Solutions, Inc.
>>>>>>  333 West San Carlos Street, Suite 700
>>>>>>  San Jose, CA 95110 USA
>>>>>>  Tel: 408-283-5639 (or 408-280-7900 x5639)
>>>>>>  fax: 408-938-6479
>>>>>>  email: alaa.zubaidi@pdf.com
>>>>>>
>>>>>>
>>>>>>  --
>>> Alaa Zubaidi
>>> PDF Solutions, Inc.
>>> 333 West San Carlos Street, Suite 700
>>> San Jose, CA 95110  USA
>>> Tel: 408-283-5639 (or 408-280-7900 x5639)
>>> fax: 408-938-6479
>>> email: alaa.zubaidi@pdf.com
>>>
>>>
>>>
>>
>>
> --
> Alaa Zubaidi
> PDF Solutions, Inc.
> 333 West San Carlos Street, Suite 700
> San Jose, CA 95110  USA
> Tel: 408-283-5639 (or 408-280-7900 x5639)
> fax: 408-938-6479
> email: alaa.zubaidi@pdf.com
>
>
>

Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
Hi Aaron,
Thanks for the help..
If I don't use the Authenticator, and keep it at AllowAll it will work 
find..
I tried provide an invalid password but it behaved the same...

Here is what i am doing:
         Map<String, String> creds = new HashMap<String, String>();
         creds.put("username", "pwd");
         AuthenticationRequest Auth = new  AuthenticationRequest(creds);

         _logger.info("In ConnectCreateCassandraSchema");

         _client.login(Auth);

         _logger.info("after login " + _keyspace);
         _client.set_keyspace(_keyspace);

It hangs in _client.login(Auth); and when I try to trap the error (no 
error message), and if I let it continue it will give me "you are not 
logged in"  on batch_mutate()

Alaa


On 11/18/2010 3:33 AM, aaron morton wrote:
> I *think* that message is just from when the connection is closed.
>
> Sorry this is a hard one to help with, as it's more than likely something to do with your client app.
> Some guessing...
>
> Everything is working if you do not use the authenticator ?
> Can you inspect the ports on the server and see if the connection is created from the client ?
> Any difference if you use an invalid password ?
> Try using Hector ?
> Try creating a new testing app from scratch.
>
> Hope that helps
> Aaron
>
> On 18 Nov 2010, at 10:03, Alaa Zubaidi wrote:
>
>> One other thing, while login() hangs when called on the server side, and nothing is logged, I see the following logged when I kill the hanged process.
>>
>> DEBUG 13:01:10,640 logged out: null
>>
>> Thanks
>>
>> On 11/17/2010 12:41 PM, Alaa Zubaidi wrote:
>>> Hi Aaron,
>>>
>>> I used the client, and was able to login.
>>> E:\cassandra>bin\cassandra-cli.bat -host 191.111.1.11 -port 9160
>>> Starting Cassandra Client
>>> Connected to: "Test Cluster" on 191.111.1.11/9160
>>> Welcome to cassandra CLI.
>>>
>>> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
>>> [default@unknown] use Realtime al 'al'
>>> Authenticated to keyspace: Realtime
>>> [alaa@Realtime]
>>>
>>> and here is whats logged sever side:
>>> DEBUG 12:38:04,921 logged in: #<User al groups=[]>
>>>
>>> I am using Java/thrift on windows.
>>>
>>> Regards,
>>> Alaa
>>>
>>> On 11/15/2010 5:37 PM, Aaron Morton wrote:
>>>> Can you try using the command line cassandra-cli tool ? fire it up and look at
>>>> the online help, if you pass a user name and password to the "use" statement it
>>>> will perform a login after setting the keyspace for the connection.
>>>>
>>>> Try testing the login that way, and see what is logged server side (with logging
>>>> at DEBUG).
>>>>
>>>> Also, what client are you using ?
>>>>
>>>> Aaron
>>>>
>>>>
>>>>
>>>> On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi<al...@pdf.com>   wrote:
>>>>
>>>>>   I removed the exception handling and It seems that the login() is hanging?
>>>>>
>>>>>   On 11/15/2010 1:36 PM, Eric Evans wrote:
>>>>>>   On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>>>>>>>   I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R
>>>>>>>
>>>>>>>   and its still the same, the error in my application is
>>>>>>>   $batch_mutate_result.read(Cassandra.java:16477)
>>>>>>>   InvalidRequestException(why: you have not logged in)
>>>>>>>
>>>>>>>   and in the system.log after DEBUG ...... Disseminating load info...
>>>>>>>   DEBUG ...... batch_mutate
>>>>>>>
>>>>>>>   There is no mention to the login() and set_keyspace() methods.
>>>>>>>   and no other information..
>>>>>>   The login() method will either raise an AuthenticationException in the
>>>>>>   client application if the login failed, or log something like "logged
>>>>>>   in: #<User username groups=groupname>" if it succeeded.
>>>>>>
>>>>>>   Either you're not actually calling login(), or your code is trapping the
>>>>>>   exception and obscuring the failure.
>>>>>>
>>>>>>
>>>>>   -- >   Alaa Zubaidi
>>>>>   PDF Solutions, Inc.
>>>>>   333 West San Carlos Street, Suite 700
>>>>>   San Jose, CA 95110 USA
>>>>>   Tel: 408-283-5639 (or 408-280-7900 x5639)
>>>>>   fax: 408-938-6479
>>>>>   email: alaa.zubaidi@pdf.com
>>>>>
>>>>>
>> -- 
>> Alaa Zubaidi
>> PDF Solutions, Inc.
>> 333 West San Carlos Street, Suite 700
>> San Jose, CA 95110  USA
>> Tel: 408-283-5639 (or 408-280-7900 x5639)
>> fax: 408-938-6479
>> email: alaa.zubaidi@pdf.com
>>
>>
>
>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by aaron morton <aa...@thelastpickle.com>.
I *think* that message is just from when the connection is closed. 

Sorry this is a hard one to help with, as it's more than likely something to do with your client app. 
Some guessing...

Everything is working if you do not use the authenticator ? 
Can you inspect the ports on the server and see if the connection is created from the client ? 
Any difference if you use an invalid password ?
Try using Hector ? 
Try creating a new testing app from scratch.

Hope that helps
Aaron

On 18 Nov 2010, at 10:03, Alaa Zubaidi wrote:

> One other thing, while login() hangs when called on the server side, and nothing is logged, I see the following logged when I kill the hanged process.
> 
> DEBUG 13:01:10,640 logged out: null
> 
> Thanks
> 
> On 11/17/2010 12:41 PM, Alaa Zubaidi wrote:
>> Hi Aaron,
>> 
>> I used the client, and was able to login.
>> E:\cassandra>bin\cassandra-cli.bat -host 191.111.1.11 -port 9160
>> Starting Cassandra Client
>> Connected to: "Test Cluster" on 191.111.1.11/9160
>> Welcome to cassandra CLI.
>> 
>> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
>> [default@unknown] use Realtime al 'al'
>> Authenticated to keyspace: Realtime
>> [alaa@Realtime]
>> 
>> and here is whats logged sever side:
>> DEBUG 12:38:04,921 logged in: #<User al groups=[]>
>> 
>> I am using Java/thrift on windows.
>> 
>> Regards,
>> Alaa
>> 
>> On 11/15/2010 5:37 PM, Aaron Morton wrote:
>>> Can you try using the command line cassandra-cli tool ? fire it up and look at
>>> the online help, if you pass a user name and password to the "use" statement it
>>> will perform a login after setting the keyspace for the connection.
>>> 
>>> Try testing the login that way, and see what is logged server side (with logging
>>> at DEBUG).
>>> 
>>> Also, what client are you using ?
>>> 
>>> Aaron
>>> 
>>> 
>>> 
>>> On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi<al...@pdf.com>  wrote:
>>> 
>>> >  I removed the exception handling and It seems that the login() is hanging?
>>> >
>>> >  On 11/15/2010 1:36 PM, Eric Evans wrote:
>>> > >  On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>>> > >>  I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R
>>> > >>
>>> > >>  and its still the same, the error in my application is
>>> > >>  $batch_mutate_result.read(Cassandra.java:16477)
>>> > >>  InvalidRequestException(why: you have not logged in)
>>> > >>
>>> > >>  and in the system.log after DEBUG ...... Disseminating load info...
>>> > >>  DEBUG ...... batch_mutate
>>> > >>
>>> > >>  There is no mention to the login() and set_keyspace() methods.
>>> > >>  and no other information..
>>> > >  The login() method will either raise an AuthenticationException in the
>>> > >  client application if the login failed, or log something like "logged
>>> > >  in: #<User username groups=groupname>" if it succeeded.
>>> > >
>>> > >  Either you're not actually calling login(), or your code is trapping the
>>> > >  exception and obscuring the failure.
>>> > >
>>> > >
>>> >
>>> >  -- >  Alaa Zubaidi
>>> >  PDF Solutions, Inc.
>>> >  333 West San Carlos Street, Suite 700
>>> >  San Jose, CA 95110 USA
>>> >  Tel: 408-283-5639 (or 408-280-7900 x5639)
>>> >  fax: 408-938-6479
>>> >  email: alaa.zubaidi@pdf.com
>>> >
>>> >
>> 
> 
> -- 
> Alaa Zubaidi
> PDF Solutions, Inc.
> 333 West San Carlos Street, Suite 700
> San Jose, CA 95110  USA
> Tel: 408-283-5639 (or 408-280-7900 x5639)
> fax: 408-938-6479
> email: alaa.zubaidi@pdf.com
> 
> 


Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
One other thing, while login() hangs when called on the server side, and 
nothing is logged, I see the following logged when I kill the hanged 
process.

DEBUG 13:01:10,640 logged out: null

Thanks

On 11/17/2010 12:41 PM, Alaa Zubaidi wrote:
> Hi Aaron,
>
> I used the client, and was able to login.
> E:\cassandra>bin\cassandra-cli.bat -host 191.111.1.11 -port 9160
> Starting Cassandra Client
> Connected to: "Test Cluster" on 191.111.1.11/9160
> Welcome to cassandra CLI.
>
> Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
> [default@unknown] use Realtime al 'al'
> Authenticated to keyspace: Realtime
> [alaa@Realtime]
>
> and here is whats logged sever side:
> DEBUG 12:38:04,921 logged in: #<User al groups=[]>
>
> I am using Java/thrift on windows.
>
> Regards,
> Alaa
>
> On 11/15/2010 5:37 PM, Aaron Morton wrote:
>> Can you try using the command line cassandra-cli tool ? fire it up 
>> and look at
>> the online help, if you pass a user name and password to the "use" 
>> statement it
>> will perform a login after setting the keyspace for the connection.
>>
>> Try testing the login that way, and see what is logged server side 
>> (with logging
>> at DEBUG).
>>
>> Also, what client are you using ?
>>
>> Aaron
>>
>>
>>
>> On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi<al...@pdf.com>  wrote:
>>
>> >  I removed the exception handling and It seems that the login() is 
>> hanging?
>> >
>> >  On 11/15/2010 1:36 PM, Eric Evans wrote:
>> > >  On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>> > >>  I set authority to SimpleAuthority and 
>> log4j.rootLogger=DEBUG,stdout,R
>> > >>
>> > >>  and its still the same, the error in my application is
>> > >>  $batch_mutate_result.read(Cassandra.java:16477)
>> > >>  InvalidRequestException(why: you have not logged in)
>> > >>
>> > >>  and in the system.log after DEBUG ...... Disseminating load 
>> info...
>> > >>  DEBUG ...... batch_mutate
>> > >>
>> > >>  There is no mention to the login() and set_keyspace() methods.
>> > >>  and no other information..
>> > >  The login() method will either raise an AuthenticationException 
>> in the
>> > >  client application if the login failed, or log something like 
>> "logged
>> > >  in: #<User username groups=groupname>" if it succeeded.
>> > >
>> > >  Either you're not actually calling login(), or your code is 
>> trapping the
>> > >  exception and obscuring the failure.
>> > >
>> > >
>> >
>> >  -- >  Alaa Zubaidi
>> >  PDF Solutions, Inc.
>> >  333 West San Carlos Street, Suite 700
>> >  San Jose, CA 95110 USA
>> >  Tel: 408-283-5639 (or 408-280-7900 x5639)
>> >  fax: 408-938-6479
>> >  email: alaa.zubaidi@pdf.com
>> >
>> >
>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
Hi Aaron,

I used the client, and was able to login.
E:\cassandra>bin\cassandra-cli.bat -host 191.111.1.11 -port 9160
Starting Cassandra Client
Connected to: "Test Cluster" on 191.111.1.11/9160
Welcome to cassandra CLI.

Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
[default@unknown] use Realtime al 'al'
Authenticated to keyspace: Realtime
[alaa@Realtime]

and here is whats logged sever side:
DEBUG 12:38:04,921 logged in: #<User al groups=[]>

I am using Java/thrift on windows.

Regards,
Alaa

On 11/15/2010 5:37 PM, Aaron Morton wrote:
> Can you try using the command line cassandra-cli tool ? fire it up and look at
> the online help, if you pass a user name and password to the "use" statement it
> will perform a login after setting the keyspace for the connection.
>
> Try testing the login that way, and see what is logged server side (with logging
> at DEBUG).
>
> Also, what client are you using ?
>
> Aaron
>
>
>
> On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi<al...@pdf.com>  wrote:
>
> >  I removed the exception handling and It seems that the login() is hanging?
> >
> >  On 11/15/2010 1:36 PM, Eric Evans wrote:
> >  >  On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
> >  >>  I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R
> >  >>
> >  >>  and its still the same, the error in my application is
> >  >>  $batch_mutate_result.read(Cassandra.java:16477)
> >  >>  InvalidRequestException(why: you have not logged in)
> >  >>
> >  >>  and in the system.log after DEBUG ...... Disseminating load info...
> >  >>  DEBUG ...... batch_mutate
> >  >>
> >  >>  There is no mention to the login() and set_keyspace() methods.
> >  >>  and no other information..
> >  >  The login() method will either raise an AuthenticationException in the
> >  >  client application if the login failed, or log something like "logged
> >  >  in: #<User username groups=groupname>" if it succeeded.
> >  >
> >  >  Either you're not actually calling login(), or your code is trapping the
> >  >  exception and obscuring the failure.
> >  >
> >  >
> >
> >  -- 
> >  Alaa Zubaidi
> >  PDF Solutions, Inc.
> >  333 West San Carlos Street, Suite 700
> >  San Jose, CA 95110 USA
> >  Tel: 408-283-5639 (or 408-280-7900 x5639)
> >  fax: 408-938-6479
> >  email: alaa.zubaidi@pdf.com
> >
> >

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Aaron Morton <aa...@thelastpickle.com>.
Can you try using the command line cassandra-cli tool ? fire it up and look at the online help, if you pass a user name and password to the  "use" statement it will perform a login after setting the keyspace for the connection. 

Try testing the login that way, and see what is logged server side (with logging at DEBUG). 

Also, what client are you using ?

Aaron



On 16 Nov, 2010,at 02:02 PM, Alaa Zubaidi <al...@pdf.com> wrote:

I removed the exception handling and It seems that the login() is hanging?

On 11/15/2010 1:36 PM, Eric Evans wrote:
> On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>> I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R
>>
>> and its still the same, the error in my application is
>> $batch_mutate_result.read(Cassandra.java:16477)
>> InvalidRequestException(why: you have not logged in)
>>
>> and in the system.log after DEBUG ...... Disseminating load info...
>> DEBUG ...... batch_mutate
>>
>> There is no mention to the login() and set_keyspace() methods.
>> and no other information..
> The login() method will either raise an AuthenticationException in the
> client application if the login failed, or log something like "logged
> in: #<User username groups=groupname>" if it succeeded.
>
> Either you're not actually calling login(), or your code is trapping the
> exception and obscuring the failure.
>
>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110 USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
I removed the exception handling and It seems that the login() is hanging?

On 11/15/2010 1:36 PM, Eric Evans wrote:
> On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
>> I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R
>>
>> and its still the same, the error in my application is
>> $batch_mutate_result.read(Cassandra.java:16477)
>> InvalidRequestException(why: you have not logged in)
>>
>> and in the system.log after DEBUG ...... Disseminating load info...
>> DEBUG ...... batch_mutate
>>
>> There is no mention to the login() and set_keyspace() methods.
>> and no other information..
> The login() method will either raise an AuthenticationException in the
> client application if the login failed, or log something like "logged
> in: #<User username groups=groupname>" if it succeeded.
>
> Either you're not actually calling login(), or your code is trapping the
> exception and obscuring the failure.
>
>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Eric Evans <ee...@rackspace.com>.
On Mon, 2010-11-15 at 12:26 -0800, Alaa Zubaidi wrote:
> I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R
> 
> and its still the same, the error in my application is
> $batch_mutate_result.read(Cassandra.java:16477)  
> InvalidRequestException(why: you have not logged in)
> 
> and in the system.log after DEBUG ...... Disseminating load info...
> DEBUG ...... batch_mutate
> 
> There is no mention to the login() and set_keyspace() methods.
> and no other information..

The login() method will either raise an AuthenticationException in the
client application if the login failed, or log something like "logged
in: #<User username groups=groupname>" if it succeeded.

Either you're not actually calling login(), or your code is trapping the
exception and obscuring the failure. 


-- 
Eric Evans
eevans@rackspace.com


Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
I set authority to SimpleAuthority and log4j.rootLogger=DEBUG,stdout,R

and its still the same, the error in my application is
$batch_mutate_result.read(Cassandra.java:16477)  
InvalidRequestException(why: you have not logged in)

and in the system.log after DEBUG ...... Disseminating load info...
DEBUG ...... batch_mutate

There is no mention to the login() and set_keyspace() methods.
and no other information..

Thanks for the help


On 11/15/2010 11:42 AM, Eric Evans wrote:
> On Mon, 2010-11-15 at 11:30 -0800, Alaa Zubaidi wrote:
>> I tried both setting authority to
>> org.apache.cassandra.auth.SimpleAuthority and AllowAllAuthority...
> If you are using SimpleAuthenticator then you should be using
> SimpleAuthority.
>
>> I uncommitted the "Application logging options" in
>> log4j-server.properties, is this enough?
> No, you need to set the log level on the root logger.  By default that
> line looks like...
>
> log4j.rootLogger=INFO,stdout,R
>
> ...and you need to make it look like...
>
> log4j.rootLogger=DEBUG,stdout,R
>
>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Eric Evans <ee...@rackspace.com>.
On Mon, 2010-11-15 at 11:30 -0800, Alaa Zubaidi wrote:
> I tried both setting authority to 
> org.apache.cassandra.auth.SimpleAuthority and AllowAllAuthority...

If you are using SimpleAuthenticator then you should be using
SimpleAuthority.

> I uncommitted the "Application logging options" in
> log4j-server.properties, is this enough?

No, you need to set the log level on the root logger.  By default that
line looks like...

log4j.rootLogger=INFO,stdout,R

...and you need to make it look like...

log4j.rootLogger=DEBUG,stdout,R


-- 
Eric Evans
eevans@rackspace.com


Re: using SimpleAuthenticator is not working

Posted by Alaa Zubaidi <al...@pdf.com>.
I tried both setting authority to 
org.apache.cassandra.auth.SimpleAuthority and AllowAllAuthority...
I uncommitted the "Application logging options" in 
log4j-server.properties, is this enough?

Thanks,

On 11/14/2010 8:10 AM, Eric Evans wrote:
> On Fri, 2010-11-12 at 17:07 -0800, Alaa Zubaidi wrote:
>> using SimpleAuthenticator is not working with me in beta 3
>>
>> I am doing the following:
>>
>> ·In Cassandra.yaml Set
>> authenticator: org.apache.cassandra.auth.SimpleAuthenticator
>> ·Add username and password to passwd.proprties
>> ·Add username to keyspace and column family permission in
>> access.proprties
>> ·Add the path for passwd.proprties and access.proprties to
>> Cassandra.bat
>> set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
>> -Dpasswd.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3
>> \conf\passwd.properties
>>
>> -Daccess.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3
>> \conf\access.properties
> Did you set authority to org.apache.cassandra.auth.SimpleAuthority?
>
>> ·Use login() to login to Cassandra in the application:
>> Map<String, String>  creds = new HashMap<String, String>();
>> creds.put("user1", "pwd1");
>> AuthenticationRequest Auth = newAuthenticationRequest(creds);
>> _client.login(Auth);
>>
>> its giving me an error, with no message, and if I try to do any thing
>> its giving me "I am not logged in" error.
>> Is there any thing I am missing?
> Make sure to set the logging level to DEBUG; there should be something
> in the logs.
>

-- 
Alaa Zubaidi
PDF Solutions, Inc.
333 West San Carlos Street, Suite 700
San Jose, CA 95110  USA
Tel: 408-283-5639 (or 408-280-7900 x5639)
fax: 408-938-6479
email: alaa.zubaidi@pdf.com



Re: using SimpleAuthenticator is not working

Posted by Eric Evans <ee...@rackspace.com>.
On Fri, 2010-11-12 at 17:07 -0800, Alaa Zubaidi wrote:
> using SimpleAuthenticator is not working with me in beta 3
> 
> I am doing the following:
> 
> ·In Cassandra.yaml Set
> authenticator: org.apache.cassandra.auth.SimpleAuthenticator
> ·Add username and password to passwd.proprties
> ·Add username to keyspace and column family permission in
> access.proprties
> ·Add the path for passwd.proprties and access.proprties to
> Cassandra.bat
> set CASSANDRA_PARAMS=-Dcassandra -Dcassandra-foreground=yes
> -Dpasswd.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3
> \conf\passwd.properties 
> 
> -Daccess.properties=E:\Cassandra\Cass07b3\apache-cassandra-0.7.0-beta3
> \conf\access.properties 

Did you set authority to org.apache.cassandra.auth.SimpleAuthority?

> ·Use login() to login to Cassandra in the application:
> Map<String, String> creds = new HashMap<String, String>();
> creds.put("user1", "pwd1");
> AuthenticationRequest Auth = newAuthenticationRequest(creds);
> _client.login(Auth);
> 
> its giving me an error, with no message, and if I try to do any thing 
> its giving me "I am not logged in" error.
> Is there any thing I am missing? 

Make sure to set the logging level to DEBUG; there should be something
in the logs.

-- 
Eric Evans
eevans@rackspace.com