Sorry to bump this, but my boss is starting to get cranky and I haven't
found anything helpful.

 

Also, what is the correct way to specify the error message on the login
screen when an exception is thrown from an AuthenticationHandler? Some
user conditions (account locked) should result in the user being bounced
to the login screen with an error message. I know I can specify that
message in the exception thrown from the AuthenticationHandler, but it's
a user-level message and shouldn't be buried in java code. Can I do
something in login-webflow.xml that adds those messages so I can tap
messages_en.properties to read them in for display on the CAS login
screen?

 

Thanks,

Eric Stein

 

From: Stein, Eric 
Sent: Tuesday, January 15, 2013 3:34 PM
To: '[email protected]'
Subject: Redirecting a login

 

My organization is using a database as our source of authentication
information, but we'd like to do some redirecting if, for example, the
user's account has been suspended. Right now I'm doing this:

 

 

public final class MycompanyAuthenticationHandler

extends AbstractJdbcUsernamePasswordAuthenticationHandler {

 

    private boolean authenticate(final String encryptedPassword)

    throws AuthenticationException {

 

        ...

 

        if (REDIRECT.containsKey(this.accountType)) {

            final String redirect = REDIRECT.get(this.accountType);

            LOGGER.debug("Redirecting to {} for account type {}",
redirect, this.accountType);

            throw new AuthenticationException("","", redirect);

        }

        ...

    }

 

That lets me leverage login-webflow.xml to get a state other than
success. Is there any other way to get another state besides throwing
the AuthenticationException? It gets logged as an ERROR with stack
trace, which is displeasing because it's neither unexpected nor a
failure and the stack trace is meaningless.

 

Thanks,

Eric Stein


-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to