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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

Custom authenticator

skadri
1-Visitor

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
14-Alexandrite
(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!

Announcements


Top Tags