Outlook API OAuth2 offline acces / permanent access using php(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 永久访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Outlook API OAuth2 离线访问/使用 php 永久访问
基础教程推荐
- 如何替换eregi() 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
