cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

login to TWx server from Java SDK with user credentials

drieder
15-Moonstone

login to TWx server from Java SDK with user credentials

Hello everyone,

 

i am trying to establish a connection from my java Application to my TWx Server. I have been using the approach with the application key. Something like this:

 

ClientConfigurator config = new ClientConfigurator();
config.setUri(ServerUri);
config.setAppKey(MyAppKey);
config.ignoreSSLErrors(true);

 

Connection client = new ConnectionClient(config);
client.connect();

 

I would rather be able to log in with the user credentials which are assigned to an application key. Is there an easy way to do this? I have read about the Authentificators, but im not sure wether they are necessary for this (hopefully) simple scenario.

 

Thank you for your help.

 

Regards,

Dominik

3 REPLIES 3
PaiChung
22-Sapphire I
(To:drieder)

Appkeys are a way to do sessionless interaction with the platform.

This is the recommended way for things like API calls.

Do you need to establish a session?

 

You should be able to pass a User name and Password or use the x-thingworxsession = true with the appkey

drieder
15-Moonstone
(To:PaiChung)

I want to establish a session yes. Can you provide me with any details on where to exactly pass user name and PW? Do i do it in the ClientConfigurator class aswell or somewhere else?

 

Thank you for your help

PaiChung
22-Sapphire I
(To:drieder)

I don't know for sure

it is either user, userName, or userId and then password or pwd I think sorry! :(

Top Tags