Sample custom plugin fails to recognize "custom" type during load

security

(Vinod) #1

Hello,
We are trying to implement shield to authenticate user access to elastic. Since the currently supported realms require user/pwd to be passed in the header and we dont have access to the logged in users pwd, we are going the route of using a custom plugin to authenticate the user given an access token.
I have downloaded the custom plugin sample, compiled and installed on my local cluster. But when i start up elastic I get the following error
Exception in thread "main" java.lang.IllegalArgumentException: unknown realm type [custom] set for realm [custom]

I currently have the following plugins - head, license, mapper-size, shield and another custom plugin for scan&scroll
The plugin itself loaded successfully on start up.

Also do I need to include the shield jar in the plugin folder?

Any help is appreciated..

Thanks
Vinod


(Jay Modi) #2

Hi Vinod,

I apologize, it looks like we did not update the versions in the pom.xml to the latest released version(s). I just created a tag for 2.1.1, https://github.com/elastic/shield-custom-realm-example/tree/v2.1.1

Can you check out that tag, build, and try installing it? One of the tests that runs with mvn verify is actually building the plugin zip, downloading the matching version of elasticsearch, shield, and licensing and then installing all of the plugins and running a test to validate the plugin works.

I did not have any issues with this test, so I believe that the plugin is working as expected. Let me know how working with the 2.1.1 tag goes.

No you should not add the shield jar to the custom realm plugin folder.

-Jay


(Vinod) #3

Hey Jay,
Thanks for your reply, I did download the latest and I was able to get the custom plugin working. The Isolated property in the descriptor.properties table had true, which was why I had to add the shield jar to the folder. Once I set it to false, i was able to take it out and run successfully.

Vinod


(system) #4