I have a requirement to authenticate with M365, which I can successfully do with a token that was previously issued. A simple DownloadImage job like this works fine with the same url:
however, I want to use SimpleMediaManager to do the same thing, via the url parameter - but it seems there is no way to set the Auth Header?
which returns ResponseError. Reason: FORBIDDEN, Response: I'm guessing because I did not pass along a token with the request, how can this be done?
B4X:
Sub DownloadImage(Link As String, myButton As Button)
Dim token As String = kvs.Get("Token")
Dim job As HttpJob
job.Initialize("", Me)
job.GetRequest.SetHeader("Authorization", "Bearer " & token)
job.Download(Link)
Wait For JobDone(job As HttpJob)
If job.Success Then
myButton.SetBackgroundImage (job.GetBitmap)
End If
job.Release
End Sub
however, I want to use SimpleMediaManager to do the same thing, via the url parameter - but it seems there is no way to set the Auth Header?
B4X:
MediaManager.SetMedia(pnl.GetView(x).GetView(0), https://xxxxx-my.sharepoint.com/personal/xxxxx/Documents/Pictures/test.jpg)
which returns ResponseError. Reason: FORBIDDEN, Response: I'm guessing because I did not pass along a token with the request, how can this be done?