question

RuchiSingh-5402 avatar image
0 Votes"
RuchiSingh-5402 asked ThomasMarchal-0372 commented

Guest Users cannot access SharePoint data using REST

Hi,

I am using REST apis to access SharePoint data by Guest users outside of SharePoint, but getting the exception - Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException.

Please help me to resolve this.

Thanks

office-sharepoint-online
· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @RuchiSingh-5402,

May I know how you perform the Auth flow? And what's the resource/scope? Can you share one example access token? It's great if you can share the background info.

Best Regards,
Baker Kong



0 Votes 0 ·

Hi Baker,

Thanks for looking into this.
We are using an external android/iOS application, wherein we are fetching data from SharePoint using REST services and displaying data. Its working fine for normal users, whereas creating issues in case of guest accounts.

Auth Flow: Using Msal :OAuth 2 client credentials flow (https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow)

Scope: https://duerr.sharepoint.com/AllSites.Read

Please let me know in case of any further queries.

Thanks for your support.




0 Votes 0 ·

Hi RuchiSingh-5402,

Per my experience, client credentials flow does not require user interaction. Can you decode the access token to check what the aud it's?

Thanks
Baker Kong


0 Votes 0 ·
Show more comments

Is it feasible to provide read-only access to the guest account, if you provide read-only access this issue will be get resolved.

0 Votes 0 ·

Read only access is already given to the user. It is not able to call the REST apis which gets the user profile, from Postman and getting exception.

0 Votes 0 ·

Hi @RuchiSingh-5402,

We are facing the same issue here. Did you receive or find any response to your question ?
Have you been able to allow Guest user to access Sharepoint sites trough the API ?
It is not clear whether this is allowed or not...

Many thanks for your help.
Regards
Thomas

0 Votes 0 ·

0 Answers