产生在轨用户API密钥网址 [英] Generate url with user Api-key in rails

查看:135
本文介绍了产生在轨用户API密钥网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要生成在轨的URL中有( WebCal的用户的API密钥://123@mywebsite.com/calendar.ics ,其中123 是该用户的认证令牌),从而使用户可以使用该链路不被登录到应用程序。如何生成这个网址?

I need to generate a url in rails that has the user's api-key in it (webcal://123@mywebsite.com/calendar.ics where '123' is the authentication token for the user), so that the user can use this link without being logged into the app. How do I generate this url?

calendar_publisher_lists_url(:format => :ics, :only_path => false,:protocol => "web cal")

生成一个链接,如 WebCal中://mywebsite.com/calendar.ics 如何添加在API密钥

推荐答案

您可以使用:用户:密码选项添加内嵌HTTP认证信息。

You can use the :user and :password options to add inline HTTP authentication information.

http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-url_for

这篇关于产生在轨用户API密钥网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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