cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Custom authenticator

skadri
1-Newbie

Custom authenticator

Hello Community,

I have been trying to create a custom authenticator. It's actually based on a parameter that I can get from the httpRequest. What i need to know is how can I, in case this parameter is absent, go back to the default authenticator.

I already done a test if it's present or not in order to return false and then the next Authenticator in the chain will be given a chance to handle the request and so on until a valid Authentication occurs.

@Override
public boolean matchesAuthRequest(HttpServletRequest req) throws AuthenticatorException {
// TODO Auto-generated method stub
if(req.getParameter("parameter1") !=null){ return true;}
else {return false ;}
}

Best regards,

1 REPLY 1
ttielebein
12-Amethyst
(To:skadri)

Hello, you are doing it exactly right! Just make sure your custom authenticator is configured to have a lower value given for priority than the basic authenticator, so anything below 100 will do. Then, if this matchesAuthRequest returns false, the default authenticators will be hit next. Here is the documentation on this: KCS Article CS244163.

Hope this helps!

Top Tags