[gatein-issues] [JBoss JIRA] (GTNWCI-29) NullPointerException in WCILoginModule when TicketService does not return credentials

Marek Posolda (Created) (JIRA) jira-events at lists.jboss.org
Wed Nov 23 17:03:40 EST 2011


NullPointerException in WCILoginModule when TicketService does not return credentials
-------------------------------------------------------------------------------------

                 Key: GTNWCI-29
                 URL: https://issues.jboss.org/browse/GTNWCI-29
             Project: GateIn Web Container Integration
          Issue Type: Bug
    Affects Versions: 2.1.0-GA
            Reporter: Marek Posolda
            Priority: Minor


In WCILoginModule is code like:

{code}
Credentials credentials = GenericAuthentication.TICKET_SERVICE.validateTicket(password, true);
sharedState.put("javax.security.auth.login.name", credentials.getUsername());
sharedState.put("javax.security.auth.login.password", credentials.getPassword());
{code}

in case that ticketService return null, we have NPE when calling credentials.getUsername().

In this case, NullPointerException is catched and rethrown as LoginException and WCILoginModule is declared as optional in GateIn/EPP. So it's minor issue without effect to users. Inspite of it, I think cleaner to handle this case in better way than throwing NullPointerException.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the gatein-issues mailing list