Coder Social home page Coder Social logo

shield-custom-realm-example's Introduction

Example of Custom Realm Plugin for Elasticsearch Shield

Introduction

This plugin contains an example custom realm for Shield.

Please make sure to use the correct branch of this repository that corresponds to the version of elasticsearch that you are developing the plugin for.

Example Plugin Branch Elasticsearch
master 5.0.0 and above
2.x 2.4.x
2.3 2.3.x
2.2 2.2.x
2.1 2.1.x
2.0 2.0.x

Creating Elasticsearch Plugin

A custom realm must be packaged using a standard Elasticsearch plugin. An Elasticsearch plugin can be written in java and built using maven. More information can be found in the Elasticsearch documentation.

In most cases, taking this project and modifying the structure should allow you get to quickly start developing your own custom realm for Elasticsearch Shield.

Building and Testing the Plugin

Checkout the branch that matches the latest officially released version of Shield and run mvn clean verify. This will compile the plugin, run unit tests, package the plugin, download elasticsearch and install the created plugin, and run tests against a cluster running this plugin.

Example Configuration

In the elasticsearch.yml file you will define a realm as specified in the Shield documentation. An example of this configuration would be:

shield:
  authc:
    realms:
      custom:
        type: custom
        order: 0
        users:
          john:
            password: changeme
            roles: user,marvel_user
          jane:
            password: changeme
            roles: admin
      esusers:
        type: esusers
        order: 1

In the above example, a custom realm is configured alongside an esusers realm. The users for the custom realm are specified in the configuration along with their roles.

Integration Points with Shield

This plugin shows an example and documents the two integrations points with Shield. These are the ability to define one or more custom realms and the ability to define a single custom authentication failure handler to control the challenges sent to the user as part of the authentication process. These classes have lots of code comments documenting their functionality.

shield-custom-realm-example's People

Contributors

jaymode avatar dadoonet avatar kimjoar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.