Results 1 to 3 of 3

Thread: Login Command

  1. #1
    Join Date
    Dec 2005
    Posts
    22

    Default Login Command

    Hey,
    I have a problem with the logincommand, so during startup I want to display the logincommand, so put (like in petsample) the logincommand in LifecycleAdvisor, so my application starts up, logo appears, login appears, I write username/passwort and press OK afterwards the startup process stucks!

    But when I do login inside the programm everything works, what can I do to fix problem,

    THX

  2. #2
    Join Date
    Aug 2005
    Location
    Austin, TX
    Posts
    425

    Default

    You'll need to provide a little more detail on the problem you're seeing. I use this exact model in my application and it works fine. I do this in my LifecycleAdvisor:

    Code:
    public void onCommandsCreated(ApplicationWindow window) {
        doUserLoginIfNeeded( window );
    }
    
    /**
     * Require the user to login if the current authentication context is empty.
     */
    protected void doUserLoginIfNeeded(ApplicationWindow window) {
        // If the user is not already logged in, then force them to do so.
        // This avoids asking the user to login again when a secondary window is opened.
        CommandManager commandManager = window.getCommandManager();
        ApplicationSecurityManager asm = getApplicationServices().getApplicationSecurityManager();
        Authentication auth = asm.getAuthentication();
        if( auth == null ) {
            _logger.info( "User not authenticated -- Force Login" );
            ActionCommand command = commandManager.getActionCommand( "loginCommand" );
            command.execute();
        }
    }
    How are you forcing the login process?

    Larry.

  3. #3
    Join Date
    Dec 2005
    Posts
    22

    Default

    Ok now it works THX!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •