Outlook API OAuth2 离线访问/使用 php 永久访问 [英] Outlook API OAuth2 offline acces / permanent access using php

查看:35
本文介绍了Outlook API OAuth2 离线访问/使用 php 永久访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照下面的教程使用 Outlook api 获取邮件.这有效,但需要用户每次登录以授予访问权限.有没有办法提供永久/离线访问?类似于 gmail api 的工作方式(当您不在键盘上时访问)

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 access? Similar to how gmail api works (access to when your not at your keyboard)

https://dev.outlook.com/RestGettingStarted/Tutorial/php

推荐答案

当然可以!为了获得离线访问,您需要将 offline_access 范围添加到您请求的范围中.这将导致刷新令牌与您的访问令牌一起发送.您可以使用刷新令牌在当前令牌过期时获取新的访问令牌.请参阅 https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-protocols/#oauth2-authorization-code-flow.

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.

这篇关于Outlook API OAuth2 离线访问/使用 php 永久访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆