Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
crln-blue
Post Patron
Post Patron

Can't connect to SAP Odata Feed in Power BI

Hello, I can't connect to SAP Odata Feed.

 

I tried all type of authentication but I still can't connect.

Screenshot 2023-10-04 132107.png

 

Screenshot 2023-10-04 132154.png

 

I tried all the options I saw here like clearing global permissions, checking the privacy level of the data, unchecking the certificate revocation check and so on. But I still can't get through.

 

Any successful attempts from anyone here?

 

Thank you.

 

 

1 ACCEPTED SOLUTION
crln-blue
Post Patron
Post Patron

Hello, 

 

I was able to connect now by making a query. The url I'm supposed to access has a format of 

 

<url>?sap-client=310

 

 where when connecting to the source, Power BI ignores anything after the question mark because it treats it as part of the query. But in my case, that part isn't a query but a header needed for the http request.

 

With that, I decided to access it by creating an m query. Got some fiddling around and this is the result:

 

let
    url = "<url here>",
    options = [
        Headers = [
            #"sap-client" = "310",
            #"Authorization" = "Basic " & "<token here>"
        ]
    ],
    Source = OData.Feed(url, null, options)
in
    Source

 

 

I placed the needed header on the Header syntax. At first, it wasn't working because Headers can only be used when the Credentials set in Permissions is Anonymous. But my case requires basic authentication that's why I placed the authorization in the Header syntax and set the credentials to anonymous.

 

permission.png

But it is also important to know what format of authorization it has. Mine was "Basic" + token but others seems like it's "Bearer" + token.

 

So that's it, putting it out here just in case.

Helpful comment when starting out in connecting via m query: https://community.fabric.microsoft.com/t5/Power-Query/Trying-to-pass-a-Bearer-token-using-the-OData-...

 

 

View solution in original post

5 REPLIES 5
NobodyTW
New Member

Hi,

I've tried to set below as header, but keep receiving error message "We couldn't authenticate with the credentials provided. Please try again."

1. credential type as anonymous

2. "Basic" authentication with encoded username and password and

3. sap-client

 

Is there anyway that we could extract data in specific sap-client using basic authorization?

 

 

The authentication should be encoded first to Base64. For example, you have the ff credentials:

username: User1

password: Password1

Both the username should bet first to Base64. I use this website to encode: https://www.base64encode.org.

And it should follow this format: username:password

 

So for our example, your token will be VXNlcjE6UGFzc3dvcmQx

 

The options header for auth will be:

#"Authorization" = "Basic " & "VXNlcjE6UGFzc3dvcmQx"

I hope this helps.

crln-blue
Post Patron
Post Patron

Hello, 

 

I was able to connect now by making a query. The url I'm supposed to access has a format of 

 

<url>?sap-client=310

 

 where when connecting to the source, Power BI ignores anything after the question mark because it treats it as part of the query. But in my case, that part isn't a query but a header needed for the http request.

 

With that, I decided to access it by creating an m query. Got some fiddling around and this is the result:

 

let
    url = "<url here>",
    options = [
        Headers = [
            #"sap-client" = "310",
            #"Authorization" = "Basic " & "<token here>"
        ]
    ],
    Source = OData.Feed(url, null, options)
in
    Source

 

 

I placed the needed header on the Header syntax. At first, it wasn't working because Headers can only be used when the Credentials set in Permissions is Anonymous. But my case requires basic authentication that's why I placed the authorization in the Header syntax and set the credentials to anonymous.

 

permission.png

But it is also important to know what format of authorization it has. Mine was "Basic" + token but others seems like it's "Bearer" + token.

 

So that's it, putting it out here just in case.

Helpful comment when starting out in connecting via m query: https://community.fabric.microsoft.com/t5/Power-Query/Trying-to-pass-a-Bearer-token-using-the-OData-...

 

 

But how can I get the token from? 

Is it encoded base64 of username:password? 

Will the above odata works for SSO sign in? 

If not, what is the process for SSO? 

I'm not sure about the SSO but if you're not connecting anonymously, it asks for the Username and Passwords which are the same SAP credentials. This is under the "Basic"

crlnblue_0-1715235720219.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.