Loading a SharePoint video requiring authorization with AVPlayer

I am trying to play videos that are part of a sharepoint list. These videos require authorization in the form of a bearer token. I have been trying to play it using AVUrlAsset by providing "AVURLAssetHTTPHeaderFieldsKey" field with headers. The result is always a faliure to load the video. I think the required "Authorization" header is not being passed correctly. What would be the right way to solve this issue?


I am targetting IOS 11.4 right now.