# Basic Authentication using RestFilter

**URL:** <https://discuss.elastic.co/t/basic-authentication-using-restfilter/97051>\
**Category:** Elasticsearch\
**Created:** [August 15, 2017, 5:12am UTC](https://discuss.elastic.co/t/basic-authentication-using-restfilter/97051 "2017-08-15T05:12:06Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![arimoham](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@arimoham](https://discuss.elastic.co/u/arimoham)\
**Post date:** [August 18, 2017, 2:36pm UTC](https://discuss.elastic.co/t/basic-authentication-using-restfilter/97051/3 "2017-08-18T14:36:57Z")

</div>

Thanks for your reply @s1monw.

My main concern is - RestController api doesn't support 'registerFilter' method anymore as shown below

@Inject  
public AuthenticationHandler(Settings settings, RestController controller) {  
super(settings);  
controller.registerFilter(new AuthenticationFilter());  
}

And also, RestFilter class is also removed from elasticsearch API, so I cant extend this class and create a custom filter class as shown below,

public class AuthenticationFilter extends RestFilter {  
}

I'm trying to follow the example given in below post,

> [@Using RestHandlers for custom Authentication Plugin](https://discuss.elastic.co/t/using-resthandlers-for-custom-authentication-plugin/90709/3):
>
> Thanks for the reply. I was able to create a basic plugin for the same in the following way.. My plugin class: public class ESPlugin extends Plugin implements ActionPlugin { public List\<RestHandler\> getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings, IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver, Supplier\<DiscoveryNodes\> nodesInCluster) { return Arrays.asList(n…

but because of above mentioned two clarifications, not sure how to proceed, please.

Could you please explain with an example or sudo code - I'm new to elasticsearch.

Many thanks in advance.

---

_[View the full topic](https://discuss.elastic.co/t/basic-authentication-using-restfilter/97051)._
