[ https://issues.apache.org/jira/browse/OFBIZ-4274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17014496#comment-17014496 ]
Nicolas Malin commented on OFBIZ-4274: -------------------------------------- I confirm the step is now closer, with adding a missing request uri and a filter call : {code:java} diff --git framework/common/webcommon/WEB-INF/common-controller.xml framework/common/webcommon/WEB-INF/common-controller.xml index 80407c67cc..b7720187cf 100644 --- framework/common/webcommon/WEB-INF/common-controller.xml +++ framework/common/webcommon/WEB-INF/common-controller.xml @@ -105,6 +105,14 @@ under the License. <security https="true" auth="false"/> <response name="success" type="request" value="main"/> </request-map> + <request-map uri="getAuthenticationToken"> + <description>Verify the user to return an authentication token</description> + <security https="true" auth="false"/> + <event type="java" path="org.apache.ofbiz.webapp.control.JWTManager" invoke="getAuthenticationToken"/> + <response name="success" type="request" value="json"/> + <response name="error" type="request" value="json"/> + </request-map> + <!-- Common Mappings used for locales and timezones --> <request-map uri="ListLocales"><security https="true" auth="false"/><response name="success" type="view" value="ListLocales" save-last-view="true"/></request-map> diff --git framework/webtools/webapp/webtools/WEB-INF/web.xml framework/webtools/webapp/webtools/WEB-INF/web.xml index 9604febb37..f47d48c69f 100644 --- framework/webtools/webapp/webtools/WEB-INF/web.xml +++ framework/webtools/webapp/webtools/WEB-INF/web.xml @@ -45,6 +45,11 @@ under the License. <param-value>component://webtools/widget/CommonScreens.xml</param-value> </context-param> + <filter> + <display-name>JWTFilter</display-name> + <filter-name>TokenFilter</filter-name> + <filter-class>org.apache.ofbiz.webapp.control.TokenFilter</filter-class> + </filter> <filter> <display-name>ControlFilter</display-name> <filter-name>ControlFilter</filter-name> @@ -63,6 +68,10 @@ under the License. <filter-name>ContextFilter</filter-name> <filter-class>org.apache.ofbiz.webapp.control.ContextFilter</filter-class> </filter> + <filter-mapping> + <filter-name>TokenFilter</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> <filter-mapping> <filter-name>ControlFilter</filter-name> <url-pattern>/*</url-pattern> {code} We can use this sequence : {code:java} $ curl -k -XPOST -d USERNAME=admin -d PASSWORD=ofbiz https://localhost:8443/webtools/control/getAuthenticationToken $ curl -k -XGET -H "Authorization: Bearer ${previousToken}" https://localhost:8443/webtools/control/entity/find/Party/Company {code} > Implement a REST Servlet > ------------------------ > > Key: OFBIZ-4274 > URL: https://issues.apache.org/jira/browse/OFBIZ-4274 > Project: OFBiz > Issue Type: New Feature > Components: framework > Affects Versions: Trunk > Reporter: Adrian Crum > Priority: Major > Labels: REST, URI > Attachments: RestExampleSchema.xsd, RestXmlRepresentation.xml, > rest-conf.xml, swagger-pos-openapi.png > > > Implement a REST servlet that will map REST requests to OFBiz services. > Details are in the comments. > [here is the discussion which took place on the dev > ML|http://markmail.org/message/ai6q2fbksowaayn4] -- This message was sent by Atlassian Jira (v8.3.4#803005)