Prompt User to Sign In to Authenticate

Hello,

I would like to prompt the user to login when a certain view is opened. I have tried to use the login event on view start up and system.perspective.login in a startup script. However, after the user has logged in it does not send the user to the view, but loads the sign in page again for the user to sign in.

Two things:

I tried placing system.perspective.authenticationChallenge() before my navigate. Although it sends me to the page now, it says that access is denied. It appears that the user is not logged in after the page is loaded.

My apologies it was the way I worded my question. I replaced authenticationChallenge with login and it works as intended. Thank you for the help.

Consider checking whether they are logged in and using .login() or .authenticationChallenge as needed.

1 Like