Version:

This lesson is part of the Perspective Components and Bindings course. You can browse the rest of the lessons below.

LESSON LIST

Autoplay Off
Take topic challenge

Supplemental Videos

LESSON

Login and Logout Actions

Description

Learn how to use actions to prompt a user to log in, or to log a user out of a Session.

Video recorded using: Ignition 8.0

Transcript

(open in window)

[00:00] In this lesson, we'll talk about the Login and Logout actions. I have a session in front of me. It has a couple of buttons, one of which has a Script action that has some security restrictions. So, if I press this button, we can see that the action was denied. I've designed it so that when you press the button, you must be authenticated, or at least logged in to the session. So, if you've designed your project in such a way that a user can have unauthenticated access, you may want to occasionally give them the chance to login, which is what the Login action is for. Now, these other buttons don't do anything right now. We'll have to configure something. So let's go ahead and close our session here. We can see that I have the view right in front of me. For my Login button, I'll simply right click, and configure events. I'll select the onClick event, and then from the action list over here, we can hit the Add icon. And we see that there is a Login action. Now when I select this action, you'll see that there's not a lot in the ways of configuration here. This action will simply prompt the user to login. Now there is one project setting you'll need to be aware of. I'll hit OK for right now. And that project setting is under Project Properties. Towards your Project Browser here, we do have our little Project Properties button you can click on. And under Perspective and General, you want to make sure you have an Identify Provider configured. In this case, I don't, which means my action would've failed, so we'll click the dropdown, I'll select my default Provider, but of course, you'd select whatever Identity Provider your organization wants you to use. We'll hit OK here. And before I head back to my session, let's talk about the Logout action real quick. I'll select the button, I'll right click on it, we'll go to the same area, we'll go to Configure Events, and again, on the onClick event, we'll hit the Add button and select the Logout action. Again, not a whole lot to configure. But let's hit OK. We've made a bunch of changes, let's save our project, and let's get that session back, so I'll just go to Tools, Launch Perspective, and I'll launch a Session. So we're back, nothing's really changed. I can't press the button because I haven't logged in yet. So if I close that little message, and I press my Login button, my session gets redirected to my Identity Provider. I'll login as Mary today, and hit Continue. We'll type in a password. I'll press Continue again, and we can see if I press my Open Popup button, in this case, it's just opening a view as a Popup. But even if you don't have this button here, you can always click on the little App Bar at the bottom of the session. And if we take a look at this center item here, we click on it, we can see that we're logged in as a particular user. And of course, if we needed to logout, you press the Logout button, which will call our Logout action, reloads the session, but of course I am no longer logged in. Right, again, if we check to see who I'm logged in as, I am now unauthenticated. So that should give you a good idea about what the Login action and the Logout action do.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.