Get embedded login window details in Perspective

How to get this additionally opened window data in to script?
I scripted a button for an authentication and need to get the verified data in Perspective. I used 'system.perspective.authenticationChallenge'

when you login, the user name will come into the session.props

The actual authenticationChallenge() function doesn't return anything but if you set up an Authentication Challenge Completed Event Script, one of the arguments that receives is a result argument containing things like the user data (if successfully authenticated).

You could try to set up a waiting thread and wait for the event to save the result to a session prop or something, but the simpler way to get the result you need is probably to split up your logic into several functions in a project library. The first part would do some set up, start the authentication challenge and that's it. Later, the auth challenge event script would call the second part itself.