我正在使用HybridAuth带有CodeIgniter 的库来Bonfire为Facebook添加登录功能.我将库和所有相关的必需文件添加到了Bonfire.
点击Login with Facebook按钮后,我被重定向到Facebook授权页面,但Facebook给出了这个错误:
无效的范围:offline_access,publish_stream,read_friendlists.此消息仅向开发人员显示.如果存在,您应用的用户将忽略这些权限.请阅读以下文档获取有效权限:https: //developers.facebook.com/docs/facebook-login/permissions ..
我怎么解决这个问题?
我正在使用Mechanize根据用户的要求刮取受密码保护的网站.我正在尝试通过运行登录到站点的Rake任务来解除登录和搜索功能,并将cookie保存到数据库中,然后由后续的Mechanize请求重用.
我的问题是该cookie_jar.save方法不会将会话cookie /令牌保存到cookie文件中.这是一个演示这个的简单示例:
require 'mechanize'
# Setup Mechanize agents
agent1 = Mechanize.new
agent2 = Mechanize.new
# Fetch page and save cookies to local file
agent1.get ('http://www.my-secure-website.com')
agent1.post('http://www.my-secure-website.com/login', {
'user[login]' => 'my_login',
'user[password]' => 'my_password',
'submit' => 'Login'
})
# Verify and save cookies
agent1.cookie_jar.save_as 'cookies'
p agent1.cookie_jar
# #<Mechanize::CookieJar:0x8cf60b8 @jar={"www.my-secure-website.com"=>{"/"=>{"JSESSIONID"=>JSESSIONID=1NqLRc4dm0Qp5465N82Zwz4N0yXxy5jP1pXpyKp9jG8ssX2nMp5q!-334818122}, "/login/"=>{"Account"=>Account=my_account_number}}, "evr.my-secure-website.com"=>{"/APBDBQ"=>{"JSESSIONID"=>JSESSIONID=A74D230DEAFF50098557FBE76DD2E0C5}}}
########################################################
# Now let's load cookies into the second Mechanize agent
# Version 1 - This works only partially. Session cookies are missing:
agent2.cookie_jar.load 'cookies'
p …Run Code Online (Sandbox Code Playgroud) 试图转换此SQLite查询
SELECT * FROM `terms` ORDER BY RANDOM() LIMIT 10
Run Code Online (Sandbox Code Playgroud)
使用Sequel模型.我得到的最接近的:
Term.order(rand{}).limit(10)
Term.order('random ()').limit(10)
Run Code Online (Sandbox Code Playgroud)
转化为
<Sequel::SQLite::Dataset: "SELECT * FROM `terms` ORDER BY 0.6160215951854449 LIMIT 10">
<Sequel::SQLite::Dataset: "SELECT * FROM `terms` ORDER BY 'random ()' LIMIT 10">
Run Code Online (Sandbox Code Playgroud)
但都不起作用.有没有办法将SQLite或其他特定于数据库的函数传递给Sequel order()?
正如标题所说,找不到什么的任何文档@something中做rvm use 2.0.0@something?
我想将网页呈现为PDF.它使用单个图像,我读过你需要提供PDFkit的绝对URL才能使用图像,所以我的代码是:
= image_tag image_url(user.avatar)
Run Code Online (Sandbox Code Playgroud)
这在以HTML格式查看时有效,并且PDFkit能够生成删除了图像的PDF.但是,在使用图像时,它会挂起,直到我杀死服务器.我怎样才能让它发挥作用?
这是杀死服务器时的完整输出:
2013-12-04 13:53:36.576 wkhtmltopdf[27410:507] CoreText performance note: Client called CTFontCreateWithName() using name "Arial" and got font with PostScript name "ArialMT". For best performance, only use PostScript names when calling this API.
2013-12-04 13:53:36.577 wkhtmltopdf[27410:507] CoreText performance note: Set a breakpoint on CTFontLogSuboptimalRequest to debug.
2013-12-04 13:53:36.582 wkhtmltopdf[27410:507] CoreText performance note: Client called CTFontCreateWithName() using name "Arial" and got font with PostScript name "ArialMT". For best performance, only use PostScript names when calling this API.
2013-12-04 …Run Code Online (Sandbox Code Playgroud) 我目前正在使用带有Heroku的Sinatra,唯一的同步是数据库.因此,我需要存储在数据库中的会话(希望不使用ActiveRecord).
是否有Rack中间件或其他类似的东西?
我们正在尝试使用Spring安全性来对我们的企业LDAP进行身份验证.我正在使用ActiveDirectoryLdapAuthenticationProvider.下面是Spring配置文件的片段:
<security:authentication-manager erase-credentials="true">
<security:authentication-provider ref="ldapActiveDirectoryAuthProvider"/>
</security:authentication-manager>
<bean id="ldapActiveDirectoryAuthProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider">
<constructor-arg value="DC=xxx,DC=ds,DC=yyy,DC=com" />
<constructor-arg value="ldap://xxx.ds.yyy.com:389" />
<property name="convertSubErrorCodesToExceptions" value="true"/>
</bean>
Run Code Online (Sandbox Code Playgroud)
我得到:ActiveDirectoryLdapAuthenticationProvider handleBindException Active Directory身份验证失败:提供的密码无效错误.
我的理解是,这是因为LDAP绑定失败,因为它正在寻找userDN /凭证.我们如何在配置文件中指定此信息?
在使用之前ActiveDirectoryLdapAuthenticationProvider,我使用<ldap-authentication-provider>和使用了这个DefaultSpringSecurityContextSource.我可以在配置DefaultSpringSecurityContextSourcebean 时指定userDN /密码.在配置使用时,有人能告诉我如何指定userDn和密码ActiveDirectoryLdapAuthenticationProvider吗?