WSO2 IS 5.0 returned SAML response with all roles in single AttributeValue as comma separated list. Now the WSO2 IS 5.1 returns all roles as own AttributeValue's.
Is it possible to get 5.1 to return roles as comma separated list in single AttributeValue?
Yes it is possible.
In Identity Server 5.1.0, it returns each role separately like below in the SAML response.
<saml2:Attribute Name="http://wso2.org/claims/role"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>admin</saml2:AttributeValue>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>Internal/everyone</saml2:AttributeValue>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>role2</saml2:AttributeValue>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>role1</saml2:AttributeValue>
</saml2:Attribute>
However, in IS 5.0.0, it was returning the roles in a single attribute as comma separated values like given below.
<saml2:Attribute Name="http://wso2.org/claims/role"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>admin,Internal/everyone,role2,role1</saml2:AttributeValue>
</saml2:Attribute>
In IS 5.1.0, if you want to get the same behavior that retrieving all roles together, you have to add following property to the particular userstore configuration. (two commas).
<Property name="MultiAttributeSeparator">,,</Property>
If it is the primary userstore, you can add it to user-mgt.xml file. If it is a secondary userstore, you can add this property to the particular configuration file in repository/deployment/server/userstores/ location.
I have explained this in the blog post [1].
[1] http://tharindue.blogspot.com/2016/09/saml-multi-valued-attributes-in-wso2.html
Related
I'm trying to create orders thanks to Prestashop WebServices. I successfully created Customers, Addresses and Carts but Order creation is crashing. Here is the error I get using the following curl request :
curl -i -X POST -d #tmpOrder.text http://secretKey#localhost:8888/api/orders
Property OrderDetail->product_price is empty
Here are the XML files I use to create my cart (and trying to create my order.
tmpCart.text
<?xml version="1.0" encoding="UTF-8"?>
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<cart>
<id></id>
<id_address_delivery>6</id_address_delivery>
<id_address_invoice>6</id_address_invoice>
<id_currency>1</id_currency>
<id_customer>2</id_customer>
<id_guest></id_guest>
<id_lang>1</id_lang>
<id_shop_group>1</id_shop_group>
<id_shop>1</id_shop>
<id_carrier>2</id_carrier>
<recyclable></recyclable>
<gift></gift>
<gift_message></gift_message>
<mobile_theme></mobile_theme>
<delivery_option></delivery_option>
<secure_key></secure_key>
<allow_seperated_package></allow_seperated_package>
<date_add></date_add>
<date_upd></date_upd>
<associations>
<cart_rows>
<cart_row>
<id_product>2</id_product>
<product_price>26.999852</product_price>
<id_product_attribute>1</id_product_attribute>
<id_address_delivery>6</id_address_delivery>
<quantity>2</quantity>
</cart_row>
</cart_rows>
</associations>
</cart>
</prestashop>
tmpOrder.txt
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink">
<order>
<id></id>
<id_address_delivery>6</id_address_delivery>
<id_address_invoice>6</id_address_invoice>
<id_cart>42</id_cart>
<id_currency>1</id_currency>
<id_lang>1</id_lang>
<id_customer>2</id_customer>
<id_carrier>2</id_carrier>
<current_state>1</current_state>
<module>cheque</module>
<payment>Chèque</payment>
<total_paid>1</total_paid>
<total_paid_real>54</total_paid_real>
<total_products>2</total_products>
<total_products_wt>54</total_products_wt>
<conversion_rate>1</conversion_rate>
<reference></reference>
<associations>
<order_rows>
<order_row>
<id></id>
<product_id>2</product_id>
<product_attribute_id>1</product_attribute_id>
<product_quantity>2</product_quantity>
<product_name>TEST</product_name>
<product_reference></product_reference>
<product_ean13></product_ean13>
<product_upc></product_upc>
<product_price>26.999852</product_price>
<unit_price_tax_incl>26.999852</unit_price_tax_incl>
<unit_price_tax_excl>26.999852</unit_price_tax_excl>
</order_row>
</order_rows>
</associations>
</order>
</prestashop>
I finally found out what is wrong. It seems that the product_attribute_id of my product was wrong. Therefore, it was looking for an inexistent price in the prices array.
I according jax-ws API integration jax-ws with Spring ,but I get an exception at my webservice project,here is API site :http://jax-ws-commons.java.net/spring/ ,I have same config xml in my project,but i get an exception is below:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'handlers' is not allowed to appear in element 'ws:service'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
who can give me solution?
The example given is wrong and not valid with regard to the schema. handlers is not an attribute, but a nested element. Use it like this:
<?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:wss="http://jax-ws.dev.java.net/spring/servlet"
xmlns:ws="http://jax-ws.dev.java.net/spring/core"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://jax-ws.dev.java.net/spring/servlet http://jax-ws.dev.java.net/spring/servlet.xsd http://jax-ws.dev.java.net/spring/core http://jax-ws.dev.java.net/spring/core.xsd">
<wss:binding url="/services/demo">
<wss:service>
<ws:service bean="#demoEndpoint">
<ws:handlers>
<ref bean="demoHandler"/>
</ws:handlers>
</ws:service>
</wss:service>
</wss:binding>
</bean>
I'm following step-by-step (basically copying and pasting stuff) this spring-ws tutorial and I just hit a wall when configuring the spring-ws-servlet.xml as below:
<?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:context="http://www.springframework.org/schema/context"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/web-services
http://www.springframework.org/schema/web-services/web-services-2.0.xsd">
<context:component-scan base-package="com.mycompany.hr"/>
<sws:annotation-driven/>
</beans>
Adding the following line:
<context:component-scan base-package="com.mycompany.hr"/>
make STS starts yelling at me that:
cvc-complex-type.2.4.c: The matching wildcard is strict,
but no declarationcan be found for element 'context:component-scan'.
I don't know how to proceed..
You need to add:
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
to the schemaLocation.
we try to use spring with metro stack to implement webservices.
The setup seems to be ok, but we get an error in the applicationContext.xml
cvc-complex-type.2.4.c: The matching
wildcard is strict, but no declaration
can be found for element
'wss:binding'.
I think that the published examples are out of date and that, for Spring 3, the binding has to be defined in a different way.
<?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:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:ws="http://jax-ws.java.net/spring/core"
xmlns:wss="http://jax-ws.java.net/spring/servlet"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
<wss:binding url="/ws">
<wss:service>
<ws:service bean="#webService"/>
</wss:service>
</wss:binding>
<!-- this bean implements web service methods -->
<bean id="webService" class="com.test.TestService"/>
</beans>
How do I have to configure the binding, or where can I find a description.
For a start, you seem to be missing this in your schemaLocation:
http://jax-ws.java.net/spring/core http://jax-ws.java.net/spring/core.xsd
http://jax-ws.java.net/spring/servlet http://jax-ws.java.net/spring/servlet.xsd
(more here, but I guess you've seen it already)
I'm trying to retrieve list data from a Sharepoint 2010 server using the webservice at DspSts.asmx. (Nope can't use oData here - long story). The WSDL suggests the following format:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
<SOAP-ENV:Header>
<dsp:authentication/>
<dsp:dataRoot>
<dsp:root>STRING </dsp:root>
</dsp:dataRoot>
<dsp:request document="" method=""/>
<dsp:versions>
<dsp:version>STRING </dsp:version>
</dsp:versions>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<dsp:queryRequest/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
So I created the following sample request code (and send it out using Oxygen XML):
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp">
<SOAP-ENV:Header>
<dsp:authentication/>
<dsp:dataRoot allowRemoteDataAccess="true" >
<dsp:root />
</dsp:dataRoot>
<dsp:request service="DspSts" document="content" method="query"></dsp:request>
<dsp:versions>
<dsp:version>1.0</dsp:version>
</dsp:versions>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<dsp:queryRequest>
<dsQuery select="/list[#id='{8F3269B6-02EA-44C5-BA2B-BA8A4D5E9C44}']" resultContent="dataOnly" columnMapping="element" resultRoot="Rows" resultRow="Row">
<Query QueryType="DSPQ">
<Fields>
<AllFields />
</Fields>
</Query>
</dsQuery>"
</dsp:queryRequest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
However when I send that query I do not get a login prompt (when I use the list web service I get one) and then an error result:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client.Dsp.InvalidSite</faultcode>
<faultstring>Failed to verify user permissions.</faultstring>
<detail>
<queryResponse xmlns="http://schemas.microsoft.com/sharepoint/dsp">
<dsQueryResponse status="failure"/>
</queryResponse>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
I'm using a hosted Sharepoint, so I don't know if I can tweak any security setting. Now my questions:
How can I enforce authentication?
What do I need to put into dsp:authentication
What to put in dsp:root
All samples I found didn't have dsp:authentication or dsp:root in it.
Help is very much appreciated
There actually is a work around. If you read a different Sharepoint web service first, e.g. Lists.asmx, then you are properly prompted for credentials and the following calls to DspSts.asmx use the digest credentials created in the first call.