Forum Discussion
How to connect to an OData source using a token
Hi all,
I need to pass a token to access an external OData api - how can this be achieved?
Thanks!
Keith.
2 Replies
- dax
Community Support
Hi Anonymous ,
You could use token in Basic authentiocation, you could refer to odata-with-power-bi for details. Or you also could try below M code(use anonymous) to see whether it work or not
let Source = OData.Feed("myOdataURL", null, [Headers = [Authorization = "My token" ] ]) in SourceBest Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi Zoe,
Thanks for your reply. Using basic just didn't work. Tried PowerQuery using your suggested solution ... = OData.Feed("https://localhost:44399/odata/", null, [Headers = [Authorization = "bearer xxxxxxxxx" ] ]) No luck at all I just get a "Edit Credentials" dialog 😞
Nothing wrong on the api side - as all is working fine through Postman. All works ok in PowerBI too once I temporarily disable auth on the api.
Thanks, Keith.