I'm using the SharePoint 2013 Rest API in my web-application and I want to write some unit tests.

GitHub has the notion of personal access token (Creating a personal access token for the commande line) which is ideal for unit-tests.

Does SharePoint have a way to retrieve OAuth access tokens without going through the OAuth flow? I found a link (Active Directory authentication scenarios) but I want to make requests on behalf of a specific user.


1 Answer 1


It's not possible, SharePoint does not offer such an access token.

As an alternative one can generate a refresh token which is valid for 6 months. This refresh token can be used to retrieve a new access token without going through an OAuth flow.

  • How do we generate a refresh token?
    – matt
    Jul 14, 2020 at 19:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.