This should help you achieve what you want. The Server Side Server Action could return the security identity instead of a server connect.