• Somnath Banik 9
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I am having a problem with using named credentials for an HTTP callout.  When I follow the example in the article titled, "Spring '15 - Simplify Authenticated Apex Callouts by Specifying Named Credentials as Endpoints" (https://help.salesforce.com/HTViewSolution?id=000206761&language=en_US" target="_blank), I get a 401 Unauthorized error from the server I'm trying to connect to.
I used Runscope to inspect the headers being sent to the server from Salesforce, and it seems that using named credentials is leaving off the "Basic" prefix from the Authorization header's value.  For example, if your username is "abc" and your password is "123", using named credentials sends this in the header:
Authorization: YWJjOjEyMw==
Instead, it should be sending this for it to work:
Authorization: Basic YWJjOjEyMw==
Is this a bug with Named Credentials?