0

I am working on a way where i can use sharepoint document url directly without any authentication required from users. For this i have got Authorization token from REST API of sharepoint successfully.

enter image description here

But when I am trying to use this token then i am getting error as token type is not allowed

enter image description here

I have followed this tutorial : http://www.ktskumar.com/2017/01/access-sharepoint-online-using-postman/

I have also given all permissions as per this tutorial.

Also I would like to ask if is there any way in which i can append this Authorization token in document url so that users don't need any authentication.

Thanks.

Annie
  • 2,397
  • 3
  • 18
  • 26

1 Answers1

1

It could be that SharePoint app-only access token is disabled by default. You could try to enable it by running the below powershell command, check if it works for you

set-spotenant -DisableCustomAppAuthentication $false
Michael Han
  • 3,475
  • 1
  • 6
  • 8
  • You need to run the command in SharePoint online powershell: https://learn.microsoft.com/en-us/powershell/sharepoint/sharepoint-online/connect-sharepoint-online?view=sharepoint-ps – Michael Han Aug 25 '21 at 05:54
  • Hi @Michael also my purpose for this is to access document urls of sharepoint without any user login. will it be possible with authorization token ' – Annie Aug 25 '21 at 07:09
  • Is there any way in which i can append this token in my url or any api list which can return me documents of perticular user ? – Annie Aug 25 '21 at 07:17
  • No, we cannot append this token in the url. However, you could download the file with the token.. – Michael Han Aug 25 '21 at 09:14
  • For you requirement, the best way is to generate a sharing link for the document that share with anyone: https://learn.microsoft.com/en-us/sharepoint/turn-external-sharing-on-or-off#file-and-folder-links – Michael Han Aug 25 '21 at 09:16
  • can you provide a REST api doc for download as well ? – Annie Aug 25 '21 at 09:20
  • This article would help you: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest#working-with-files-by-using-rest – Michael Han Aug 25 '21 at 09:26
  • Hi @Michael I want to ask one more thing is it possible to generate authorization token based on email and password instead of client id and secret ? – Annie Aug 26 '21 at 05:33
  • Hi @Michael can you please reply on this ?? – Annie Aug 30 '21 at 08:53