Sending data via header cookie to the clients from custom auth handler

12 views
Skip to first unread message

Ramakrishna G

unread,
Feb 6, 2018, 7:51:14 AM2/6/18
to CAS Community
Hello 

I am using CAS Version 5.2.1 with a Custom Authentication Handler. I need to set custom cookies after validating user in my Custom Authentication Handler. How can set cookies?

@Override

    protected HandlerResult authenticateUsernamePasswordInternal(final UsernamePasswordCredential transformedCredential,  final String originalPassword)

            throws GeneralSecurityException, PreventedException 

    {

        try 

        {

            final String username = transformedCredential.getUsername();

            

            ..//My authentication code 

             

            if(success)

            {

                //I need to Set cookie here

                HandlerResult result = createHandlerResult(transformedCredential, this.principalFactory.createPrincipal(username), null);

                return result;

            }

        } 

        catch (final Exception e) 

        {

            throw new FailedLoginException();

        }

    }   


Thanks
Ramakrishna G  
Reply all
Reply to author
Forward
0 new messages