Ok, so I have used OAuth and gotten my JWT token and I’m having a lot of success using the REST API to do what I want to do (upload/download files and folders) however, when I get a list of sites I get some sites that I can see but I cannot get into, I get an ‘Invalid Audience’ error.
So I get the oath token and then I run a query to get all the sites available
https://example-my.sharepoint.com/_api//search/query?querytext='contentclass:sts_site'
I get
- webUrl =
https://example.sharepoint.com/sites/contentTypeHub
- webUrl =
https://example-public.sharepoint.com
- webUrl =
https://example.sharepoint.com
- webUrl =
https://example.sharepoint.com/sites/asdf
- webUrl =
https://example.sharepoint.com/portals/community
- webUrl =
https://example-my.sharepoint.com/personal/prince_oberon_b...k_io
- webUrl =
https://example-my.sharepoint.com/personal/zst...rt_example_onmicrosoft_com
- webUrl =
https://example-my.sharepoint.com/personal/jaime_lannister_b...k_io
- webUrl =
https://example-my.sharepoint.com/personal/ned_stark_b...k_io
- webUrl =
https://example-my.sharepoint.com/personal/a...ek_example_onmicrosoft_com
I am able to do everything I want with the example-my subdomains, but not the other domains.
- My JWT Token audience is ‘"aud":"https://example-my.sharepoint.com/“,’
- My request url is https://example.sharepoint.com/sites/asdf/_api/Web/folders
- The response is {“error":"invalid_client","error_description":"Invalid audience Uri 'https://example-my.sharepoint.com/'."}
So to restate, my understanding is I need a different JWT token for each domain (example,example-public, example-my) is that right?
If that is right, do I need to have the user go through the auth steps for each one?
Thank you for any regard you give my question.