Reply
kxwillis
Regular Visitor

Invalid Auth Header from Web Activity for SalesForce

I am issuing a request to a SalesForce bulk API 2.0 from web activity but am receiving an INVALID_AUTH_HEADER resposne and am not sure why.  I do have a valid token from the previous web activity and am passing it in the header of this web activity.  Sample header from the configuration below.

 

{
"method": "GET",
"headers": {
"Authorization": "Bearer [token]",
"x-ms-date": "Mon, 20 May 2024 20:11:11 GMT",
"Content-Type": "application/json"
},
"relativeUrl": "/services/data/v51.0/sobjects/Account"
}

14 REPLIES 14
smeetsh
Resolver I
Resolver I

Does this thread help you perhaps? I myself struggled to find out how to send a bearer token to a copy action, which used a GET

kxwillis
Regular Visitor

OUTPUT OF WEB ACTIVITY 1
{
"access_token": "00D5Y000001bchT!AQEAQDaYCiIjOZKYySRwnpsY3CloFGzEiTc0abZNK60LiEtqJWnRAvEHwrX363RTqbqwNz.[rest of token]",
"signature": "KY58auRKT0Y4JdvVU/WRo6/WHvfqMoepYoHgm636nso=",
"token_type": "Bearer",
"issued_at": "1716566138903",
"ResponseHeaders": {
"Date": "Fri, 24 May 2024 15:55:38 GMT",
"Set-Cookie": "CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000; secure;LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000; secure;BrowserId=ENrFgBnmEe-_7qNw1875lg; domain=.salesforce.com; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000",
"Strict-Transport-Security": "max-age=63072000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Robots-Tag": "none",
"Cache-Control": "no-store, must-revalidate, no-cache, max-age=0, private",
"Vary": "Accept-Encoding",
"Transfer-Encoding": "chunked",
"Expires": "Thu, 01 Jan 1970 00:00:00 GMT",
"Content-Type": "application/json; charset=UTF-8"
},
"executionDuration": 0
}
 
INPUT OF WEB ACTIVITY 2
{
    "method": "POST",
    "headers": {
        "Authorization": "Bearer 00D5Y000001bchT!AQEAQDaYCiIjOZKYySRwnpsY3CloFGzEiTc0abZNK60LiEtqJWnRAvEHwrX363RTqbqwNz.[rest of token]",
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    "relativeUrl": "/services/data/v51.0/jobs/query",
    "body": {
        "operation": "query",
        "query": "SELECT Id FROM Account WHERE RecordType.Name <> 'Provider Account'"
    }
}
 
kxwillis_0-1716566302096.png

 

avatar user
Anonymous
Not applicable

Hi @kxwillis ,

Thanks for using Fabric Community.
As part of debugging process, can you please test the rest api working perfectly with the help of postman?
Identify the if the right URL is getting constructed, and debug from the response.
If possible can you please share the screenshot of your issue. I would be able to guide you better if you can provide these details.

Hello and thank you for your reply.  While working this request through Postman I received additional information the object I am intending to query may not be supported in a client credentials auth flow.  I am checking with SalesForce support on what items I need to enable to support query base objects using client credentials.

avatar user
Anonymous
Not applicable

Hi @kxwillis ,

Thanks for the reply. Do let me know incase of further queries with Fabric.

avatar user
Anonymous
Not applicable

Hi @kxwillis ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet .
In case if you have any resolution please do share that same with the community as it can be helpful to others .
Otherwise, will respond back with the more details and we will try to help .

The permissions issue in SalesForce was resolved and verified yesterday, so the process works in Postman now.  However, I am still receiving the INVALID_AUTH_HEADER response when implementing inside of the web activity in Fabric.  See the below...

 

WEB ACTIVITY INPUT
{
    "method": "POST",
    "headers": {
        "Authorization": "Bearer [token]",
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    "relativeUrl": "/services/data/v51.0/jobs/query",
    "body": {
        "operation": "query",
        "query": "SELECT Id FROM Account WHERE RecordType.Name <> 'Provider Account'"
    }
}
 
WEB ACTIVITY OUTPUT
{
"Response": "[{\"message\":\"INVALID_AUTH_HEADER\",\"errorCode\":\"INVALID_AUTH_HEADER\"}]",
"ResponseHeaders": {
"Date": "Fri, 24 May 2024 12:58:08 GMT",
"Set-Cookie": "CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 12:58:08 GMT; Max-Age=31536000; secure;LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 12:58:08 GMT; Max-Age=31536000; secure;BrowserId=ROBfwxnNEe-4RlOJI9bR_g; domain=.salesforce.com; path=/; expires=Sat, 24-May-2025 12:58:08 GMT; Max-Age=31536000",
"Strict-Transport-Security": "max-age=63072000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Robots-Tag": "none",
"Cache-Control": "no-store, must-revalidate, no-cache, max-age=0, private",
"WWW-Authenticate": "Token",
"Transfer-Encoding": "chunked",
"Content-Type": "application/json; charset=UTF-8"
},
"executionDuration": 0
}
avatar user
Anonymous
Not applicable

Hi @kxwillis ,

I would like to understand how are you sending Bearer token in Fabric Web Activity?

Can you please refer the below similar threads -
Ingest data form a rest API with Oauth2 - Microsoft Fabric Community
Solved: retrieve token api call with content type x-www-fo... - Microsoft Fabric Community

Hope this is helpful. Do let me know incase of further queries.

I am retreiving the token from the web activity immediately preceeding this step and am passing the token from the output of the preceeding web activity.

 

kxwillis_0-1716560805471.png

 

avatar user
Anonymous
Not applicable

Hi @kxwillis 

Can you please share the screen shot of web activity web1 when you executed the pipeline?
As the above error says authentication, I would like to understand whether it is passing actual bearer token or not.

Below is the output of web activity 1 and the input of webactivity 2

 

OUTPUT OF WEB ACTIVITY 1
{
"access_token": "00D5Y000001bchT!AQEAQDaYCiIjOZKYySRwnpsY3CloFGzEiTc0abZNK60LiEtqJWnRAvEHwrX363RTqbqwNz.[rest of token]",
"signature": "[signature]",
"token_type": "Bearer",
"issued_at": "1716566138903",
"ResponseHeaders": {
"Date": "Fri, 24 May 2024 15:55:38 GMT",
"Set-Cookie": "CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000; secure;LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000; secure;BrowserId=ENrFgBnmEe-_7qNw1875lg; domain=.salesforce.com; path=/; expires=Sat, 24-May-2025 15:55:38 GMT; Max-Age=31536000",
"Strict-Transport-Security": "max-age=63072000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Robots-Tag": "none",
"Cache-Control": "no-store, must-revalidate, no-cache, max-age=0, private",
"Vary": "Accept-Encoding",
"Transfer-Encoding": "chunked",
"Expires": "Thu, 01 Jan 1970 00:00:00 GMT",
"Content-Type": "application/json; charset=UTF-8"
},
"executionDuration": 0
}
 
INPUT OF WEB ACTIVITY 2
{
    "method": "POST",
    "headers": {
        "Authorization": "Bearer 00D5Y000001bchT!AQEAQDaYCiIjOZKYySRwnpsY3CloFGzEiTc0abZNK60LiEtqJWnRAvEHwrX363RTqbqwNz.[rest of token]",
        "Content-Type": "application/json",
        "Accept": "application/json"
    },
    "relativeUrl": "/services/data/v51.0/jobs/query",
    "body": {
        "operation": "query",
        "query": "SELECT Id FROM Account WHERE RecordType.Name <> 'Provider Account'"
    }
}
 
Screenshot of pipeline execution below
kxwillis_0-1716571182758.png

 

avatar user
Anonymous
Not applicable

Hi @kxwillis ,

Based on the images, it looks like there is no issue with the configuration.
Might be the issue is with the token as the error says INVALID_AUTH_HEADER.

The best course of action is to open a support ticket and have our support team take a closer look at it.

 

Please reach out to our support team so they can do a more thorough investigation on why this it is happening: Link 

 

After creating a Support ticket please provide the ticket number as it would help us to track for more information.

 

Hope this helps. Please let us know if you have any other queries.

 

avatar user
Anonymous
Not applicable

Hi @kxwillis ,

We haven’t heard from you on the last response and was just checking back to see if got a chance to open a support ticket.
After creating a Support ticket please provide the ticket number as it would help us to track for more information.

Thanks

Thanks for the followup.  The support ticket number is 2405290040004729

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)