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();
}
}
I found this
link
https://stackoverflow.com/questions/21434885/how-to-access-the-httpservletresponse-from-a-custom-cas-authenticationhandler-to
but what dependency I need for this? Also setting cookie code..
Thanks
Ramakrishna G
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/b855707b-ebdd-4b47-b4c3-a2dbcabc0396%40apereo.org.