Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
Whenever you try to enter a mashup and you didn't type any user and password - pop up will be displayed on the screen to insert user and password.
My request is: no matter to what mashup a user is trying to enter if it has no credentials it will be forwarded to specific known mashup.
How can I do it?
Thanks in advance
Assaf
Hi Assaf,
Could you please provide a bit more details/description to the request? I might be misunderstanding.. The request is if the credentials are missing, even if the user tries to hit a specific mashup, their traffic is rerouted to a “landing page” type mashup, where they are prompted for credentials? If that is the case, would a form login work?
Or are you looking for a credentialless access of mashup if a specific link is provided? Then the appkeys should be sufficient
.
Thank you in advance for your time and patience!
Most likely you'll need a custom Authenticator for this.
The Authenticator can intercept the Auth and do a redirect.
How this can be done?
I want to avoid the attached screen.
I want the user to be redirected to a specific known thingworx login mashup or other mashup
Hello Assaf Elgov,
As Pai mentioned, you need to create a Thingworx Extension - please refer to Thingworx Extension guide for further details. Extensions for Thingworx are created in Java and they are great if you need to extend the possibilities of the Platform.
One of the entity types you can create in the Extension is an Authenticator. It's an object that can handle / process the authentication request. In every Authenticator you should implement three methods (please find more here: PTC). One is authenticate, it takes two parameters - HttpRequest and HttpResponse. In this method you should implement your logic (e.g. to take the URL of the request:
String url = httpServletRequest.getRequestURI(); // e.g. /Thingworx/Runtime/...
Then you can redirect to another URL:
httpServletResponse.sendRedirect("/Thingworx/Runtime/index.html#mashup=b");
Notice, that there is a bunch of OOTB Authenticators in Thingworx ant every has its priority (order). If prior Authenticator is fired and authenticates user successfully, the rest is skipped.
Please also note, that if you redirect to another mashup, it would require login from the user anyway. That's why I recommend to redirect to the Organizational login page, which then allows to login in a nicer-looking way:
httpServletResponse.sendRedirect("/Thingworx/FormLogin/<OrganizationName>");
Don't forget, that User needs to be a member of the Organization to be able to use its Login Page to authenticate.
Hope it helps, if you need any further assistance, don't hesitate to ask.
Regards,
J.
I do want to forward to a organizaion page.
I have organiztion where all the users as access to.
Will it make any diffrence in terms of solving my issue or I still need to create a custom extension?
Hi Assaf Elgov,
If you need to make redirections, then I'm afraid you need to create Extension. Other possibility is to create Tomcat filters, but that's more complicated and complex task. For more informations regarding Authenticators, please refer to Thingworx Help Center: Digital Media Publisher.
Please note, that if my previous answer helped you, you can mark it as a good answer for other to refer.
If you have any additional questions regarding Authenticators, please don't hesitate to ask.
Regards,
J.
So, as far as you know, Is there OOTB extension for my use?
I've just checked the Marketplace and there is unfortunately no such extension. But it's not so hard to create one, if you have any Java experience.
What if I want to make my own custom login page, Where should I start?
Don't forget I need all the users access it without typing any user and password.
Hi Assaf,
You can just create a FormLogin page for Everyone organization (if you have Universal Access, so - if in the Everyone organization there is Users group).
Then all your users can access http://<host>:<port>/Thingworx/FormLogin and log in there.
Regards,
J.
This is what we have right now.
We want to design this page, not just changing the color and adding logo.