wso2 보안 토큰 서비스 용 .NET 클라이언트를 만들어야합니다.wso2 보안 토큰 서비스 용 .NET 클라이언트를 만드는 방법
일반적으로 간단한 콘솔 또는 WinForm 프로젝트에 서비스 참조를 추가하여 만듭니다. 노출 된 WSDL은 서비스를 쿼리하고 응답을 적절하게 관리하는 데 사용할 수있는 클래스 집합으로 바뀝니다.
생성 된 요청 및 응답 클래스는 비어 있습니다. 속성이나 메서드가없는 클래스 선언 만 비어 있습니다. 이것은 다른 (답이없는) 스택 오버플로 질문에 설명 된 동작과 비슷합니다. http://cxf.547215.n5.nabble.com/Sample-STS-Client-tp4643980p4664175.html 및 SOAP UI에서 작동하도록 만들었습니다.이 포럼 게시물의 서비스 샘플 요청을 발견했습니다.
보안 토큰 서비스를 쿼리하는 데 필요한 복잡한 데이터 구조를 다시 만들 수있는 자동화 된 방법이 있습니까?
편집 나는 여전히 STS 서비스에서 RequestSecurityTokenResponse를 얻기 위해 필요한 최소한의 구조 위의 포럼 게시물에서 SOAP 요청을 감소 많은 시도 후
OK.
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-6D35592DCDDA26FFF3141578725699577">
<wsse:Username>USERNAME HERE</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD HERE</wsse:Password>
</wsse:UsernameToken>
<wsu:Timestamp wsu:Id="TS-6D35592DCDDA26FFF3141578725699576">
<wsu:Created>2014-11-12T10:14:16.995Z</wsu:Created>
<wsu:Expires>2014-11-12T10:16:16.995Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
<wsa:Action soap:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT</wsa:Action>
<wsa:MessageID soap:mustUnderstand="1">uuid:6d4eab69-77f9-42b7-8d6b-1f710020fb0b</wsa:MessageID>
<wsa:To soap:mustUnderstand="1">STS ENDPOINT ADDRESS HERE</wsa:To>
</soap:Header>
<soap:Body>
<wst:RequestSecurityToken xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust">
<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>
<wst:TokenType>http://schemas.xmlsoap.org/ws/2005/02/sc/sct</wst:TokenType>
<wst:Claims>
<wsid:ClaimType Uri="http://wso2.org/claims/userid" xmlns:wsid="http://schemas.xmlsoap.org/ws/2005/05/identity"/>
</wst:Claims>
</wst:RequestSecurityToken>
</soap:Body>
</soap:Envelope>
나는 내 프로젝트의 app.config에서 정의하는 부분적인 성공을 얻은 다음과 같은 단일있는 wsHttpBinding 중 하나
: 또는 다음과 같은 CustomBinding을 추가하지 않고<wsHttpBinding>
<binding name="SendUsername" messageEncoding="Text">
<security mode ="TransportWithMessageCredential">
<message clientCredentialType ="UserName"/>
<transport clientCredentialType ="Basic" />
</security>
</binding>
</wsHttpBinding>
<customBinding>
<binding name="wso2carbon-stsSoap12Binding">
<security defaultAlgorithmSuite="Default" authenticationMode="IssuedToken"
requireDerivedKeys="true" securityHeaderLayout="Lax" includeTimestamp="true">
<localClientSettings detectReplays="false" />
<localServiceSettings detectReplays="false" />
<issuedTokenParameters keyType ="SymmetricKey" tokenType ="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0">
<issuer address =STS ENDPOINT ADDRESS HERE binding ="wsHttpBinding" bindingConfiguration ="SendUsername"/>
<claimTypeRequirements>
<add claimType ="http://wso2.org/claims/userid"/>
</claimTypeRequirements>
</issuedTokenParameters>
</security>
<textMessageEncoding messageVersion="Soap12" />
<httpsTransport />
</binding>
</customBinding>
그러나 두 경우 모두 요청이 시간 초과 예외를 throw하고 WCF가 요청 된 요청을 추적하여 Claims 요소가 누락되었음을 확인할 수 있습니다. 어떤 힌트?
감사를 체결되지 않더라도이 유효한 답으로 간주 될 수 있기를 바랍니다,하지만 그들은이 이유가 나를 도울 수 없습니다. 첫 번째는 서비스 구성에 액세스 할 수 없다는 것이고 두 번째는 샘플이 Java에 있고 .NET 클라이언트가 필요하다는 것입니다. – sblandin