Petals BC REST

Add support of JWT authentication

Details

  • Type: Improvement Request Improvement Request
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1-BC
  • Fix Version/s: 1.1.0-BC
  • Component/s: Provider mode
  • Security Level: Public
  • Description:
    Hide

    The BC Rest should expose resources protected with a JSON Web Token as service. Please add support of JWT authentication, that can be configured as following:

    <jbi:jbi ...>
       <jbi:services ...>
          <jbi:provides ...>
             ...
             <rest:mapping>
                ...
                <rest:operation name="ged:consulter">
                   ...
                   <rest:authentication>
                      <rest:jwt>
                         <rest:claim>
                            <rest:name>
                               <rest:constant>name1</rest:constant>
                            </rest:name>
                            <rest:value>
                               <auth:constant>value1</rest:constant>
                            </rest:value>
                         </rest:claim>
                         <rest:claim>
                             <rest:name>
                                <rest:constant>name2</rest:constant>
                             </rest:name>
                             <rest:value>
                                <rest:xpath>...</rest:xpath>
                              </auth:value>
                         </rest:claim>
                         <rest:compress-with>DEF</auth:compress-with>
                         <rest:sign-with algorithm="HS256">
                            <rest:key-file-url>file:///tmp/key</rest:key-file-url>
                         </rest:sign-with>
                      </rest:jwt>
                   <rest:authentication>
                   ...
                </rest:operation>
                ...
             </rest:mapping>
          </jbi:consumes>
       </jbi:services>
    </jbi:jbi>

    NOTE: placeholders must be supported to be able to configure: claim name, claim value and key file url outside the SU !

    Show
    The BC Rest should expose resources protected with a JSON Web Token as service. Please add support of JWT authentication, that can be configured as following:
    <jbi:jbi ...>
       <jbi:services ...>
          <jbi:provides ...>
             ...
             <rest:mapping>
                ...
                <rest:operation name="ged:consulter">
                   ...
                   <rest:authentication>
                      <rest:jwt>
                         <rest:claim>
                            <rest:name>
                               <rest:constant>name1</rest:constant>
                            </rest:name>
                            <rest:value>
                               <auth:constant>value1</rest:constant>
                            </rest:value>
                         </rest:claim>
                         <rest:claim>
                             <rest:name>
                                <rest:constant>name2</rest:constant>
                             </rest:name>
                             <rest:value>
                                <rest:xpath>...</rest:xpath>
                              </auth:value>
                         </rest:claim>
                         <rest:compress-with>DEF</auth:compress-with>
                         <rest:sign-with algorithm="HS256">
                            <rest:key-file-url>file:///tmp/key</rest:key-file-url>
                         </rest:sign-with>
                      </rest:jwt>
                   <rest:authentication>
                   ...
                </rest:operation>
                ...
             </rest:mapping>
          </jbi:consumes>
       </jbi:services>
    </jbi:jbi>
    NOTE: placeholders must be supported to be able to configure: claim name, claim value and key file url outside the SU !
  • Environment:
    -

Activity

Hide
Christophe DENEUX added a comment - Thu, 15 Jun 2017 - 10:40:53 +0200

Support added in trunk

Show
Christophe DENEUX added a comment - Thu, 15 Jun 2017 - 10:40:53 +0200 Support added in trunk

People

Dates

  • Created:
    Thu, 15 Jun 2017 - 08:42:09 +0200
    Updated:
    Thu, 15 Jun 2017 - 10:40:53 +0200
    Resolved:
    Thu, 15 Jun 2017 - 10:40:52 +0200