Forum Discussion

SachinS's avatar
SachinS
New Contributor
7 years ago

Expression to fetch the Authorization header value from incoming request

I have to fetch the Authorization header value and pass it to next REST API call.
Please reply if some one has know. how to retrieve it.

7 Replies

  • The Authorization header is not accessible from a pipeline. Is it possible to also pass the value of the header in the request body?

    • SachinS's avatar
      SachinS
      New Contributor

      That means we can not fetch header values in SnapLogic Pipeline.
      I have to pass the Basic Authorization value i.e “Basic XXXXXXXX”.

      So only way is to pass through request body. Will you suggest some other options.

      Please provide your inputs.

      • tlikarish's avatar
        tlikarish
        Employee

        You can access certain headers from the request, for example:

        • CONTENT_TYPE
        • HTTP_ACCEPT
        • HTTP_ACCEPT_ENCODING
        • HTTP_DATE
        • HTTP_USER_AGENT
        • HTTP_REFERER

        But not authorization.

        If you’re not able to pass through the request body, I’m not sure there are a whole lot of other options.

        The only other way I can think to do this is if there are a finite number of users. Then you could preconfigure REST Basic Auth accounts for those users and pass the account name as part of the request. Then in the pipeline you could dynamically set the account depending on the account name passed in.

  • tstack's avatar
    tstack
    Former Employee

    I just wanted to ask a clarifying question. It sounds like you’re wanting to get the Authorization header that is passed to a triggered task, is that right? What API are you going to be calling in the pipeline that would use the SnapLogic user credentials?

  • SachinS's avatar
    SachinS
    New Contributor

    Yes, your are correct. Below is the API call:-
    /api/1/rest/public/users/UserName