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 永久访问


- 如何使用 Google API 在团队云端硬盘中创建文件夹? 2022-01-01
- openssl_digest vs hash vs hash_hmac?盐与盐的区别HMAC? 2022-01-01
- 如何从数据库中获取数据以在 laravel 中查看页面? 2022-01-01
- 覆盖 Magento 社区模块控制器的问题 2022-01-01
- PHP - if 语句中的倒序 2021-01-01
- 使用 GD 和 libjpeg 支持编译 PHP 2022-01-01
- Oracle 即时客户端 DYLD_LIBRARY_PATH 错误 2022-01-01
- 如何在 Symfony2 中正确使用 webSockets 2021-01-01
- Laravel 5:Model.php 中的 MassAssignmentException 2021-01-01
- PHP foreach() 与数组中的数组? 2022-01-01