HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD

classic Classic list List threaded Threaded
7 messages Options
DS DS
Reply | Threaded
Open this post in threaded view
|

HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD


ClientConfiguration cfg = new ClientConfiguration()
        .setAddresses("127.0.0.1:10800")
        .setUserName("ignite")
        .setUserPassword("ignite");
 try (IgniteClient igniteClient = Ignition.startClient(ClientCfg)) {

        igniteClient.query(new SqlFieldsQuery("ALTER USER IGNITE WITH
PASSWORD 'test'")).getAll()
}catch {...}

Using java thin client I am able to connect the server with default username
= 'ignite' and password = 'ignite'.

 if I try to change the password via above  Alter query,
it throws me this error :

org.apache.ignite.internal.client.thin.ClientServerError: Ignite failed to
process request [1]: Operation failed
[nodeId=f0f0660d-3063-4a66-a25c-c8ca44d06cd2,
opId=c21a59ad071-98068f3f-df17-4b3e-9222-e747fc738ccf, err=class
org.apache.ignite.internal.processors.authentication.UserManagementException:
User doesn't exist [userName=IGNITE]] (server status code [1])










--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
dbutkovic dbutkovic
Reply | Threaded
Open this post in threaded view
|

Re: HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD

try with ALTER USER 'ignite' WITH PASSWORD 'test'





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD

Hello!

ALTER USER "ignite" WITH PASSWORD 'new password';

Yep!

Regards,
--
Ilya Kasnacheev


вт, 17 мар. 2020 г. в 15:00, dbutkovic <[hidden email]>:
try with ALTER USER 'ignite' WITH PASSWORD 'test'





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
DS DS
Reply | Threaded
Open this post in threaded view
|

Re: HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD

Hello,

The below query ran without throwing any error. :

      igniteClient.query(new SqlFieldsQuery("ALTER USER \"ignite\" WITH
PASSWORD 'password'"));

But  when I am trying  to connect with new password i.e.
     ClientCfg.setUserName("ignite");
     ClientCfg.setUserPassword("password");
     Ignition.startClient(ClientCfg)

It throws an exception >
SEVERE: The user name or password is incorrect [userName=ignite]





--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
dbutkovic dbutkovic
Reply | Threaded
Open this post in threaded view
|

Re: HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD

 I think that username must be in single quote without \

igniteClient.query(new SqlFieldsQuery(" ALTER USER 'ignite' WITH PASSWORD
'password' "));



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
DS DS
Reply | Threaded
Open this post in threaded view
|

Re: HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD



igniteClient.query(new SqlFieldsQuery(" ALTER USER 'ignite' WITH PASSWORD
'password' "));

igniteClient.query(new SqlFieldsQuery(" ALTER USER "ignite'' WITH PASSWORD
'password' "));

1) Both give the same result. i.e query runs without throwing any
error/exception.

2) Unable to connect with the new password.

3) Again tried with 'ignite' as password, it connects back.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
ilya.kasnacheev ilya.kasnacheev
Reply | Threaded
Open this post in threaded view
|

Re: HOW TO CHANGE IGNITE JAVA THIN CLIENT PASSWORD

Hello!

I have just rechecked this case:
1) start persistent node.
2) try changing password - failure (cluster not active)
3) activate cluster (control.sh --activate, ignite/ignite)
4) try changing password - success.
5) check with sqlline - new password (test) accepted.
6) try connecting with thin client and ignite/ignite again - failure.

Are you sure you're not losing your cluster together with all data between runs?

igniteClient.query(new SqlFieldsQuery("ALTER USER \"ignite\" WITH PASSWORD 'test'")).getAll();

Regards,
--
Ilya Kasnacheev


ср, 18 мар. 2020 г. в 11:47, DS <[hidden email]>:


igniteClient.query(new SqlFieldsQuery(" ALTER USER 'ignite' WITH PASSWORD
'password' "));

igniteClient.query(new SqlFieldsQuery(" ALTER USER "ignite'' WITH PASSWORD
'password' "));

1) Both give the same result. i.e query runs without throwing any
error/exception.

2) Unable to connect with the new password.

3) Again tried with 'ignite' as password, it connects back.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/