问题列表 - 第36080页

数据格式化程序暂时不可用,将在"继续"后重试

这是我收到的错误消息:

ContactsWithPN - start loop
Program received signal:  “0”.
Data Formatters temporarily unavailable, will re-try after a 'continue'. (Unknown error loading shared library "/Developer/usr/lib/libXcodeDebuggerSupport.dylib")
Run Code Online (Sandbox Code Playgroud)

以下是导致此问题的代码:

+(NSArray *) contactsWithPhoneNumbers{
    NSArray *contacts = [ABContactsHelper contacts];
    NSMutableArray *rv = [[NSMutableArray alloc] init];
    NSLog(@"ContactsWithPN - start loop");
    for (int i = 0; i< [contacts count] ; i++) {
        ABContact * c = (ABContact*)[contacts objectAtIndex:i];
        ABContact * fullContact = [ABContact  contactWithRecordID:[c recordID]];

        if ([[fullContact phoneArray] count] > 0) {
            [rv addObject:fullContact];
        }
    }
    NSLog(@"ContactsWithPN - …
Run Code Online (Sandbox Code Playgroud)

iphone memory-management fullcontact

4
推荐指数
1
解决办法
6071
查看次数

使用OpenSAML和OpenSSO进行签名验证问题

我们在服务提供商网站上使用OpenSAML为我们的客户提供SSO.我们的客户(ID提供商)正在使用OpenSSO.OpenSSO发布的SAML响应在签名元素方面略有不同,因为它不受命名空间限定.这似乎与OpenSAML相关并且它从samlResponse.getSignature()方法返回null ,因此我无法验证签名.

导致问题的SamlReponse的签名片段

<Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <SignedInfo>
        <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <Reference URI="#s2d10cccbd58d1f78c2c76c74c82a236548c929ffd">
            <Transforms>
                <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
            </Transforms>
            <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
            <DigestValue>j+KBoDOtEcyCquPTxRCXoBulStQ=</DigestValue>
        </Reference>
    </SignedInfo>
    <SignatureValue>Dv+owuZfGFymGGrw2gHA3/7GVC6mXt8JMW+tOvmtnjTRJZaDE+Nb2NCngio1Tnqu4LWnvVrry4Wk... 6QcIJi/kGc4YFMSQj/Q=</SignatureValue>
    <KeyInfo>
        <X509Data>
            <X509Certificate>MIIEhDCCA+2gAwIBAgIQXxhipi2wpPxWi7MTVfFVHDANBgkqhkiG9w0BAQUFADCBujEfMB0GA1UE... 78Q/lRQuBhHMy02lKctnwjBeEYA=</X509Certificate>
        </X509Data>
    </KeyInfo>
</Signature>
Run Code Online (Sandbox Code Playgroud)

来自另一个可用的SAML响应的签名片段

<dsig:Signature xmlns="http://www.w3.org/2000/09/xmldsig#" xmlns:dsig="http://www.w3.org/2000/09/xmldsig#">
    <dsig:SignedInfo>
        <dsig:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
        <dsig:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
        <dsig:Reference URI="#id-TtLltjcBSOAJ6OipumUEj8o0Qag-">
            <dsig:Transforms>
                <dsig:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                <dsig:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
            </dsig:Transforms>
            <dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
            <dsig:DigestValue>5c95zhA139qzMvZA2A445F3LWaU=</dsig:DigestValue>
        </dsig:Reference>
    </dsig:SignedInfo>
    <dsig:SignatureValue>JsmRFJn1CjClHs4rf0hrwKzOq6ZtmnOEm/PNiaJvYurko/ZP+PApWhk55x0unIVwZ6XDv3k8Dj81WqUl07J0Dkvzp71bccIgiGTRzoNPT71nBAXxJmZiXz51JWctg13zjxP0oQMSpWytKCrFkCkJ0So3RQl3WixYV3miK0YjJnM=</dsig:SignatureValue>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    </ds:KeyInfo>
</dsig:Signature>
Run Code Online (Sandbox Code Playgroud)

如您所见,OpenSSO服务器中的签名片段不包含SAML绑定规范中指定的命名空间限定符.

对我来说,最后一个选项是对发布的SAMLResponse进行一些按摩,以便将命名空间添加到签名元素中,以使OpenSAML库工作.

关于如何使用OpenSAML库解决这个问题的任何想法都受到高度赞赏.

在此先感谢CJ

xml opensso signature saml xml-signature

5
推荐指数
1
解决办法
2907
查看次数

如何使用spring security 2.0在我的JSP页面中显示错误消息

嗨,我现在使用弹簧安全.它工作正常.但如果登录失败,则不会显示错误消息.我想知道如何显示错误信息?

我在applicationContext.xml中配置了ResourceBundleMessageSource

<!-- Spring security error message config -->
    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basenames">
             <list>
                  <value>messages</value>
             </list>
        </property>
    </bean>
Run Code Online (Sandbox Code Playgroud)

还有我的security-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:David="http://www.springframework.org/schema/security"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
                           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                           http://www.springframework.org/schema/security
                           http://www.springframework.org/schema/security/spring-security-2.0.xsd">

    <David:http auto-config="true" access-denied-page="/accessDenied.html">

        <!-- Don`t set any role restriction on login.jsp -->
        <David:intercept-url pattern="/login.jsp"
            access="IS_AUTHENTICATED_ANONYMOUSLY" />

        <!-- Restrict access to All other pages -->
        <David:intercept-url pattern="/admin.jsp"
            access="ROLE_ADMIN" />

        <!-- Set the login page and what to do if login fails -->
        <David:form-login login-page="/login.jsp"
            default-target-url="/"/>
        <David:logout logout-success-url="/" />
    </David:http>

    <!-- …
Run Code Online (Sandbox Code Playgroud)

spring spring-security

6
推荐指数
2
解决办法
3万
查看次数

Spring Security 3 - 未授予任何权限

我想在Weblogic Server上使用ldap进行身份验证,但我总是遇到这样的问题:

认证:真实; 详细信息:org.springframework.security.web.authentication.WebAuthenticationDetails@fffe3f86:RemoteIpAddress:127.0.0.1; SessionId:WhgyMmQddKLfnFjhTLn5Thl421hWZ8sLV732ctYLSLhQpQLW1JFR!-860386732!1285980317840; 没有授予任何权力

更多细节:

Oct 02 2010 00:45:25 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor - Previously Authenticated: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@d4d8c77d: Principal: org.springframework.security.ldap.userdetails.LdapUserDetailsImpl@13b1fb5: Username: weblogic; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ; Password: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffe3f86: RemoteIpAddress: 127.0.0.1; SessionId: WhgyMmQddKLfnFjhTLn5Thl421hWZ8sLV732ctYLSLhQpQLW1JFR!-860386732!1285980317840; Not granted any authorities
Oct 02 2010 00:45:25 DEBUG org.springframework.security.access.vote.AffirmativeBased - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@c00076, returned: -1
Oct 02 2010 00:45:25 DEBUG org.springframework.security.web.access.ExceptionTranslationFilter - Access is denied (user is not anonymous); delegating to AccessDeniedHandler
org.springframework.security.access.AccessDeniedException: Access is denied …
Run Code Online (Sandbox Code Playgroud)

weblogic ldap spring-security

5
推荐指数
1
解决办法
7065
查看次数

JavaScript的最后一次主要修订是什么时候?

我想买一本入门书,而且预算紧张.亚马逊的二手书价格不错,但我不想在v4出局时买错C#v2书.

即使在JS页面的历史部分,维基百科也没有任何亮点.对于声明"购买xxxx之后出版的书,你会好吗?",有人能告诉我xxxx的价值吗?

javascript

6
推荐指数
1
解决办法
149
查看次数

数据库脱机时symfony会发生什么?

连接到symfony的数据库脱机或无法访问时会发生什么?也许这个问题的答案在我的脸上并且我没有意识到,但我一直在寻找最后一次并仍然空手而归.

我试图通过停止数据库服务(在我的Windows笔记本电脑上开发 - 在LAMP服务器上部署)来自己模拟(在"生产"环境中),但它只是坐在那里直到它超过了PHP执行时间限制.

我正在使用Doctrine运行symfony 1.4.可以假设它会抛出某种可捕获的异常,甚至可能设置连接超时然后抛出异常.我忍不住想到一个客户只是坐在那里30秒等待数据库查询完成永远不会发生的事情.

如果symfony核心中已经没有任何预防措施,那么任何人都可以就如何处理它做出任何建议吗?我当然会在数据库上安装一个心跳监视器,但如果它发生故障,该站点也需要被删除.

更新:将测试脚本放在一起,通过Mysqli连接到localhost数据库,它仍然达到最大执行时间.但是,它确实为失败的连接发出警告.

- 洛根

php mysql doctrine symfony1

2
推荐指数
1
解决办法
1049
查看次数

Javascript正则表达式[删除事件]

有谁知道一个好的正则表达式来从html中删除事件。

例如,字符串:
"<h1 onmouseover="top.location='http://www.google.com">Large Text</h1> Befores "<h1>Large Text</h1>
So保留了HTML标签,但删除了onmouseover,onmouseout,onclick等事件。

提前致谢!

javascript regex events

2
推荐指数
1
解决办法
2308
查看次数

KSoap-Android \ JCIFS发送空的HTTP帖子

我基于KSOAP-Android和JCIFS创建了NTLM身份验证SOAP客户端。实现看起来像这样:

public class NtlmServiceConnection implements ServiceConnection 
{
    public NtlmServiceConnection(final SoapConnectionInfo connectionInfo, String path)      
    {
        httpclient = new DefaultHttpClient();
        httpclient.getAuthSchemes().register(AuthPolicy.NTLM, new NTLMSchemeFactory());

    //...

    @Override
    public InputStream openInputStream() throws IOException {
        ByteArrayEntity re = new ByteArrayEntity(bufferStream.toByteArray());
        post.removeHeaders("CONTENT-LENGTH");
        post.setEntity(re);
        HttpResponse rep = httpclient.execute(post);
        InputStream stream = rep.getEntity().getContent();
        return stream;
    }

    //....
}
Run Code Online (Sandbox Code Playgroud)

从外观上看,KSOAP正在生成正确的消息,因为bufferStream按预期填充了SOAP信封。JCIFS似乎正在完成其工作,而且我可以看到通过Wireshark进行了NTLM挑战响应。问题是消息正文丢失。它只是null。因此,Web服务遇到501,InputStream返回的为null。

有人知道为什么会发生这种情况吗?

注意:我要删除下面的CONTENT-LENGTH标头,因为setEntity显然试图设置它,但是KSOAP已经设置了它。我只是将其删除并允许对其setEntity进行重置。

android ntlm jcifs http ksoap2

5
推荐指数
1
解决办法
3454
查看次数

禁止在简单的PHP登录系统中访问文件

我写了这个非常简单的PHP登录系统:

<?php
    session_start();
    $error = '';

    if (isset($_POST['username']) && isset($_POST['password']))
    {
        if ($_POST['username'] == 'user' && $_POST['password'] == 'pass')
        {
            $_SESSION['client'] = 'ok';
            Header ("location: /kit/kit/index.php");
        }
        else
        {
            $error = 'Usuario o contrase&ntilde;a incorrectos.';
        }
    }

?>
Run Code Online (Sandbox Code Playgroud)

不必担心漏洞问题,它不会保护任何有价值的东西。

在每个.php页面中,我添加:

<?php
    session_start();

    if (!isset($_SESSION['client']) || $_SESSION['client'] != 'ok')
    {
        Header ("location: /kit/index.php");
        die();
    }

?>
Run Code Online (Sandbox Code Playgroud)

这样可以很好地保护.php会话。

问题在于这不能保护文件。

我的意思是如果直接去:

东西/其他/file.zip

无论您是否登录,它将下载它。

我希望这个问题很清楚,如果不能,请提出!

php passwords session protection password-protection

5
推荐指数
0
解决办法
4279
查看次数

在Oracle SQL中合并两个字符串

有没有办法合并查询中返回的两个字符串,如下所示:我有一个字符串 '<6 spaces>XYZ'和其他字符串'<3 spaces>ABC<3 spaces>'.基本上每个字符串分为3个部分,任何部分中的两个将为空白.我想合并这两个字符串以产生输出:'<3 spaces> ABCXYZ'.

另一个例子可以是'ABC<6 spaces>'和字符串'<6 spaces>DEF' 应该产生的'ABC<3 spaces>DEF>'

sql string oracle plsql

2
推荐指数
1
解决办法
3701
查看次数