4 Replies Latest reply on May 29, 2018 10:37 AM by tstiemerling

    Example realm mapper configuration?

    tstiemerling

      Does anyone have an example for an Elytron regex realm mapper configuration?

        • 1. Re: Example realm mapper configuration?
          mchoma

          "simple-regex-realm-mapper" => {

                          "description" => "Definition of a simple RealmMapper that attempts to extract the realm name using the capture group from the regular expression, if that does not provide a match then the delegate RealmMapper is used instead.",

           

          <simple-regex-realm-mapper name="SimpleOne" pattern="(.?)" delegate-realm-mapper="CustomRealmOne" />

           

           

          "mapped-regex-realm-mapper" => {

                          "description" => "Definition of a RealmMapper implementation that first uses a regular expression to extract the realm name, this is then converted using the configured mapping of realm names.",

           

          <mapped-regex-realm-mapper name="MappedOne" pattern="(.?)" delegate-realm-mapper="SimpleOne">

              <realm-mapping from="a" to="b" />

              <realm-mapping from="c" to="d" />

          </mapped-regex-realm-mapper>

          • 2. Re: Example realm mapper configuration?
            tstiemerling

            Thanks.

             

            So in the mapped regex the "from" should be what comes out of the regex capture group and the "to" should be a defined realm?

             

            Also, is there any example code anywhere showing how to write a custom realm mapper class?

            • 3. Re: Example realm mapper configuration?
              mchoma

              Yes.

               

              Custom Realm Mapper in example is just example. It can be any standard realm mapper.

              • 4. Re: Example realm mapper configuration?
                tstiemerling

                Hi martin, I meant is there example code of the implementation of a custom realm mapper available?