How to Make a Customized Login Page in Perspective

As we know, the official loin page in Persepctive looks like this:


The problem is that now I wanna make a customized login page with the url of ‘/’, if my home page is ‘/home’, then when I first open the browser and get into ‘/’ page, I don’t need to know the password, instead I can just type in the homepage url ‘/home’ and make the login page useless.
Could anybody tell me How to deal with this problem?
Thank you guys so much.

Hi @Jay_L, just wanted to clarify :slight_smile:

Is the issue that you’re able to bypass the authentication stage by using the URL?

If so, have you correctly setup security correctly on your Views and components (see here for more info)?

Thank you Matthew!!
However, I don’t know how to acctually set the user to be the one I’ve set to be allowde to access the session in Perspecitve when I click in my own login button, because the function “system.security.switchUser” requires Vision module.
Looking forward to your help!!!

The correct function for Perspective is system.perspective.login() :slight_smile:

This will redirect to the Ignition’s authentication page though, which I am guessing is not what you want. You will likely need to redirect it to your own login page.

Yes the Ignition’s authentication page is not I want, that why this topic exists :joy: :joy: :joy:
And what do you mean I can edirect it to your own login page, it really confuses me cause without the help of the function, I am still unable to authenticate.

You’re not the first one to bring this up.

See: [feature-13896]Customizing Perspective Login Page

As I understand it, this is not something they will develop for easy customization. Using an IDP helps, but even with that setup the auto-logout redirects to that screen. As far as I’m aware, it’s not possible to avoid it completely.

2 Likes

Thank you for your help my friend.
I wonder how much does the IDP helps? Is it possible to let the user type in the usr and the pwd in the customized login page?
As far as I understand from your topic and the answer above, it looks unreachable so far?

I’m no expert, we did this with support from another company more familiar with IDPs, but if you use an IDP you can make your login page look however you want. We’re currently using Google and Microsoft accounts linked to the IDP configured in Ignition, and we use Ignition security levels and rules to admit domains and specific user accounts. So yes, you can have a custom login page in this way.

However, in some cases when the system logs out by itself due to timeout, it redirects to the normal Ignition login page. If you try to login from there it redirects users again to the main IDP login page configured on the perspective project.

In terms of actually “changing” the default Ignition login page with some sort of customization, yes, it is unreachable.

A year or so ago I tried making a perspective project that functioned as a “project gateway” and I made a custom login project. The project was public, so it skipped the login page, but I encountered too many issues that I couldn’t handle via scripting properly. So I gave up on it. There’s been many updates since then, so maybe you could try this. But if you want to avoid the ignition login view completely I’m not sure it’s possible.

Youy detailed explaining is fascinating my friend and I really benefit from it.


Also,Is this the service you mentioned that Google provided to enable us to connect the Identity Provider with the google account then make it possible to login using google account?

We used the Microsoft Azure IDP, not the google one. We then linked the google one. But in theory yes any IDP that supports OpenID or SAML2.0 should work.

Keep in mind our solution is a bit more complex than a straight IDP, we added some middleware to add some other features.

A year or so ago I tried making a perspective project that functioned as a “project gateway” and I made a custom login project. The project was public, so it skipped the login page, but I encountered too many issues that I couldn’t handle via scripting properly. So I gave up on it. There’s been many updates since then, so maybe you could try this. But if you want to avoid the ignition login view completely I’m not sure it’s possible.

Could you give me some specifics about what you couldn't handle ?
I'm currently in the process of making one of those project gateway, and I'm curious as to what didn't work for you. Maybe It can help me avoid some headache in the future.

As I recall the main issue was the way the login/logout/redirect worked. I think logging in and redirecting was not an issue, but when you logged out the scope of the logout script didn’t allow the code to execute properly. Though I honestly don’t remember and they have added functions since my last attempt, so you might not encounter the issues I had at all.

I think I see what you mean, I had a similar problem. But I don’t actually want to log the user out, since his login info are the same as the project he’s being redirected too, I just wanted to close the session to avoid having too many perspective session opened at the same time… Which was easy enough:

system.perspective.navigate(url=self.view.params.url)
system.perspective.closeSession(self.session.props.id)

Thanks for the answer