Custom authenticator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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,
- Labels:
-
Extensions
-
Security
- Tags:
- authentication
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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!