Outlook API OAuth2 offline acces / permanent access using php

后端 未结 2 1567
后悔当初
后悔当初 2021-01-13 03:22

I followed the tutorial below to get mail using outlook api. This works, but requires the user to login every time to give access. Is there a way to give permanent / offline

2条回答
  •  野的像风
    2021-01-13 03:56

    Absolutely! In order to get offline access, you need to add the offline_access scope to your requested scopes. This will result in a refresh token being sent along with your access token. You can use the refresh token to get a new access token when the current one expires. See the "Refresh the Access Token" section of https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols/#oauth2-authorization-code-flow.

提交回复
热议问题