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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Mashup session parameters in Java

jrajesh
7-Bedrock

Mashup session parameters in Java

Hi,

How can we set the session parameter value for a mashup before showing the mashup in a Custom Java Extension?

Thanks and Regards,

Jyothi

6 REPLIES 6
paic
1-Newbie
(To:jrajesh)

What is the use case for this?

To be able to set the right session parameter, it has to be within the User Session Context, so if you are trying to set it server side, it still has to be invoked through that particular user's session.

Earliest timing you can use would be the Mashup loaded event and you can use the services within the CurrentSessionInfo Resource to set the Session parameter.

jrajesh
7-Bedrock
(To:paic)

What I want to do is:

1) Take the username and password from the user.

2) Based on these, set a specific value somewhere

3) Be able to access this value when I load the Mashup.

paic
1-Newbie
(To:jrajesh)

You won't be able to retrieve the User's password.

I think the easier way to go would be either using the User Extensions or Use Groups.

User Extensions if they have to be unique values, and please note that Server side, using the CurrentSessionInfo Resource you can get the CurrentUser (user who is logged in)

Groups if a set of Users all will receive the same value (then from CurrentUser, derive the group to derive the value)

I believe the system provides what you need without the necessity of creating a custom extension.

jrajesh
7-Bedrock
(To:paic)

Ok. Let me explain the complete use case.

There is another site which accepts the username/password, authenticates it and then gets the customer id/name.

Now there will be a link on that site which will point to a mashup on our site. I need to pass this customer id or name to this mashup.

I was thinking of using a Custom Authenticator for this purpose so that when the other site invokes our mashup, it may be able to pass the customer id/name in the url of the link which I can access as a request parameter in my Custom Authenticator and then set this value somewhere so that the Mashup can access it.

paic
1-Newbie
(To:jrajesh)

You could just pass on a user name and password from your other site, however if you are authenticating on the other site, that is an unsafe method and not recommended.

So indeed you should use a Custom Authenticator (you can get more information on this on the Support Portal)

I'm not sure if beyond that, you need to carry something over from that portal into Thingworx, if so, you can have the portal do a separate REST API call to Thingworx to set a User Extension value.

@Rajesh by any chance did you resolve this issue? If so how?

We have similar use case. Appreciate your response.

Thanks

Pavan

Announcements


Top Tags