[英]Rails OAuth: Can't get refresh token from microsoft office 365 rest api
I'm trying to figure out how to get the refresh token from an office365 user with omniauth. 我试图弄清楚如何使用omniauth从office365用户获取刷新令牌。
In my devise.rb
file I have tried two different ways but to no avail: 在我的devise.rb
文件中,我尝试了两种不同的方法,但无济于事:
config.omniauth :microsoft_office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_SECRET'],
access_type: 'offline',
scope: 'https://outlook.office.com/calendars.read'
config.omniauth :microsoft_office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_SECRET'],
scope: 'https://outlook.office.com/calendars.read, offline_access'
Am I doing something wrong here? 我在这里做错什么了吗?
It turns out the offline_access scope needn't be defined in devise.rb
. 事实证明,无需在devise.rb
定义offline_access范围。 All you have to do is add the scope in the Microsoft Application Registration Portal . 您所要做的就是在Microsoft 应用程序注册门户中添加范围。
For me, the microsoft_office365 config line in devise.rb
now looks like this: 对我来说, devise.rb
的microsoft_office365配置行现在看起来像这样:
config.omniauth :microsoft_office365, ENV['OFFICE365_APP_ID'], ENV['OFFICE365_SECRET'],
scope: 'https://outlook.office.com/calendars.read'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.