带有用户身份验证令牌的 Rails webcal 订阅 url;
我正在尝试为我的应用程序的用户创建一个链接,用于订阅他们的帐户日历。我有一个在 Rails calendar_publisher_lists_url(:format => :ics, :only_path => false,:protocol => "web cal") 中生成的有效链接 它会生成一个类似 webcal://mywebsite.com/calendar.ics 的链接 但是,这仅在用户登录时才有效。即使用户未登录,我也需要在日历自动更新时使链接正常工作。因此,我需要生成一个如下所示的链接: webcal://[电子邮件受保护]/calendar.ics 其中“123”是用户的身份验证令牌。 我如何生成这个网址?
I am trying to create a link for user of my app to use to subscribe to their account calendars. I have a link that works that I generate in rails calendar_publisher_lists_url(:format => :ics, :only_path => false,:protocol => "web cal")
which generates a link like webcal://mywebsite.com/calendar.ics
However this only works if the user is logged in. I need for the link to work when the calendar is automatically updated, even if the user is not logged in. Thus I need to generate a link that would look like:
webcal://[email protected]/calendar.ics where '123' is the authentication token for the user.
How do I generate this url?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将它作为属性放在 URL 上有什么问题吗?
我的意思是除了安全问题...
What's wrong with putting it onto the URL as attribute?
I mean apart from the security issue...
如果安全不是问题,您可以更改路由以添加 ID。
然后在你的控制器中
添加一个视图模板,调整以适应你的逻辑需求(此代码来自我的一个项目):
然后提要链接将是
If security is not an issue you could change the route to add an id.
Then in your controller put
And then add a view template, adjust to fit your needs with your logic (this code is from one of my projects):
Then the feed link would be