Skip to main content
1-Visitor
December 27, 2021
Question

How to create external user session in thingWorx and how logout external user session

  • December 27, 2021
  • 3 replies
  • 2275 views

Hello,

i have one table(User) in database and this table have some users data like username and password.

So when i login with user present in database by using username(abc) and password(abc@123) it's logging in successfully but when i tried to logout this user by using logout function, it's logging out the thingworx composer user instead of logout the user present which i have in my database. So how i logout the user username(abc) and password(abc@123) ? please share the resolution on this......

 

NOTE:- 1. Have created mashup for users to login and logout using database.
2. Required user session and only logout the username, password not an whole composer.
3. I have user from database and want only login and logout that database only.

 

 

3 replies

15-Moonstone
December 28, 2021

Hi,

 

I think you should call the LogOut funcion which is available in Mashup composer on the right side. It basically take care of all logout formalities behind the scene. You can call some service before making call to this function to set some flag in DB to show if the user is logged in or log out.

 

Regards

Shyam

1-Visitor
December 28, 2021

Can you please provide syntax or demo code for flag in DB

1-Visitor
December 28, 2021

or for ThingWorx service

12-Amethyst
December 29, 2021

There is a terminate user session method pls check it out...

19-Tanzanite
December 30, 2021

hi @BS_10072462 

Can you please clarify the following points?

  1. You say you have a database table which holds users and passwords? Is this a custom table that you created or ThingWorx's users table.
  2. Are the users you have in that table exactly the users present in ThingWorx? How do you authenticate them?
  3. ThingWorx has a built-in logout functionality only for its users. As BABA-SHYAM mentioned, that's what we use all the time and if you need to logout users in any other system, you should build and call some services before calling this function. If how to do that is not clear, please invest some time in ThingWorx training, as these are basic concepts. Also, I must note that the concept of "logging of" in this situation is purely up to you to decide how to implement, because it seems you are not speaking about ThingWorx users. This type of work has no relationship with ThingWorx, if what I understood is correct.