Home

Results 1 to 2 of 2

Thread: Driver REST - GET call with variable Authorization header

Threaded View

  1. #1
    Join Date
    Dec 2015
    Posts
    28

    Driver REST - GET call with variable Authorization header

    Hi guys,

    I'm working on a custom REST Driver and I need to do some REST calls with a variable authorization header.

    I receive User events in this driver and I need to do a GET call using the login information of the current User.

    In my custom Output policy I build the Authorization header with the user login info, encoding it in Base64 and do the call as follows:

    Code:
    <nds dtdversion="4.0" ndsversion="8.x">
      <source>
        <product edition="Standard" version="4.5.3.0">DirXML</product>
        <contact>NetIQ Corporation</contact>
      </source>
      <input>
        <driver-operation-data class-name="profileServiceDo" command="query">
          <request>
            <url-token profileService="profileService.do"/>
            <header Authorization="Basic ASFDioZdESoSifdasfaidSOIOg=="/>
            <value>{}</value>
          </request>
        </driver-operation-data>
      </input>
    </nds>
    [10/18/16 14:59:01.121]:Driver Profiles ST:            DrvProfiles: sub-execute
    [10/18/16 14:59:01.121]:Driver Profiles ST:            DrvProfiles: queryHandler
    [10/18/16 14:59:01.121]:Driver Profiles ST:            DrvProfiles: queryHandler: class-name  == 'profileServiceDo'
    [10/18/16 14:59:01.122]:Driver Profiles ST:            DrvProfiles: Query: preparing GET to https://apps.ce.collabserv.com/profiles/atom/profileService.do
    [10/18/16 14:59:01.123]:Driver Profiles ST:            DrvProfiles: Setting the following HTTP request properties:
     Authorization: <content suppressed>
    [10/18/16 14:59:01.124]:Driver Profiles ST:            DrvProfiles:  Authorization: Basic ASFDioZdESoSifdasfaidSOIOg==
    [10/18/16 14:59:01.125]:Driver Profiles ST:            DrvProfiles: Did a HTTP GET with 0 bytes of data to https://apps.ce.collabserv.com/profiles/atom/profileService.do
    When I get the response it says 401 Unauthorized:

    Code:
    [10/18/16 14:59:15.484]:Driver Profiles ST:            DrvProfiles: Response code and message: 401 Unauthorized
    [10/18/16 14:59:15.485]:Driver Profiles ST:            SubscriptionShim.execute() returned:
    [10/18/16 14:59:15.485]:Driver Profiles ST:
    <nds dtdversion="3.0">
      <source>
        <product build="20150722_0750" version="1.0.0.0">Identity Manager REST Driver</product>
        <contact>NetIQ Corporation.</contact>
      </source>
      <output>
        <status level="error" type="driver-general">
          <driver-operation-data class-name="profileServiceDo" command="query" dest-dn="">
            <response>
              <url-token profileService="profileService.do"/>
              <header Authorization="Basic ASFDioZdESoSifdasfaidSOIOg=="/>
              <value></value>
            </response>
          </driver-operation-data>
        </status>
      </output>
    </nds>
    I tried the same REST call from a Chrome REST extension successfully with a 200 OK code, so the call is well made.
    I tried again the REST call without Authorization header from the Chrome REST extension and returned the 401 Unauthorized code.

    So my conclusion is that the driver is not using my authorization header, is using the one from the driver configuration instead, which one is empty.

    My question is, how can I force the driver to use my header for authorization and not the empty one from the driver configuration?

    Thanks in advance,
    Rodrigo
    Last edited by rcano; 18-Oct-2016 at 02:25 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •