Search code examples
sharepointpermissionsmicrosoft-graph-apiazure-cognitive-search

How long are delegated permissions valid for in Sharepoint Indexer?


If I use delegated permissions in the Graph API, how long do these permissions allow me to access a sharepoint site as the data source for a cognitive search data source before I would need to renew my permissions?


Solution

  • When you are using Graph API to query a sharepoint site, what you are doing is obtaining an access token which containing the correct API permission to call that API to get the site information.

    The API permissions won't expired whenever it is granted, and we can only remove the API permission to make it "expired". So how long depends on how long the access token will expire. You can see this section to learn about the access toke lifetime and how to manage it. But we also need to know the token can be renewed by refresh token when you want to renew it, and you can also generate a new token directly.

    So it's hard to say how long it will allow you to query the site. It depends on if you set the lifetime for the token and how you manage the token generating and usage.