I'm currently trying to use Role-based permission on Micro-Integrator v 7.1.0 while calling api request, i've already managed to use REST Basic AuthHandler as shown below, which works just fine.
<handlers>
<handler class="org.wso2.micro.integrator.security.handler.RESTBasicAuthHandler"/>
</handlers>
Now i want to add role permission to it, but i can't seem to find a way on how to.
I found some code that worked on older versions, but apparently not on 7.1
<handler class="org.wso2.api.authorization.RoleBasedAuthorizationHandler">
<property name="roles" value="testRole"/>
</handler>
Any suggestions on how to make this work? Thanks.
I implemented a new authorization handler for MI. You can find it here. If you find any bugs please report them back to the Github project.
Once you add the Jar you can engage the Handler as shown below.
<handlers>
<handler class="com.ycr.auth.handlers.AuthorizationHandler">
<property name="roles" value="admin,test" />
<property name="authorize" value="true" />
</handler>
</handlers>
Related
I am using ActiveMQ Version 5.7.0 with Jetty on a RHEL 7 VM.
I have already enabled the ssl connector to access the web console via https.
Now I am trying to configure a webconsole access redirect from HTTP to HTTPS but I am really struggling with it.
In have found this guideline for "How to have Jetty redirect https to https" in this forum site: https://serverfault.com/questions/367660/how-to-have-jetty-redirect-http-to-https
I have problems to follow both steps since:
Step 1: Configure the web.xml file --> I don't know which of the following is the correct one:
apache-activemq-5.7.0/webapps/fileserver/WEB-INF/web.xml
apache-activemq-5.7.0/webapps/admin/WEB-INF/web.xml
Step 2: The instruction looks very different from the jetty.xml file of ActiveMQ where different connectors are used:
<property name="connectors">
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<property name="port" value="8161" />
</bean>
<bean id="SecureConnector" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<property name="port" value="8162" />
<property name="keystore" value="file:${activemq.conf}/broker.ks" />
<property name="password" value="password" />
</bean>
</list>
</property>
Can anyone help me please?
Thanks very much in advance.
The admin web app is the one you want to modify. The fileserver web app is for uploading files and it was removed in 5.14.0 via AMQ-6276 due to security issues (e.g. CVE-2016-3088).
I strongly encourage you to upgrade to the latest release.
I'm using WSO2 IS 5.3.0 in a clustered environment.
It was noticed that the claims are not being displayed in the default user profile in any of the users even after they are given as "Supported by Default". I even restarted the nodes one by one assuming it was a caching issue but that did not solve the issue either.
What could be the possible reason for this behaviour?
Could this be a configuration error?
Where should I be looking specifically(which configurations) in order to narrow down the issue?
Any valuable solution/suggestion is highly appreciated.
Thanks in advance.
After some research found out that the exact issue was simply a missing tag in the user-mgt.xml file inside <WSO2_IS_HOME>/repository/conf
<Property name=”initializeNewClaimManager”>true</Property>
After adding the missing configuration as mentioned below, the default profile displayed the claims as expected.
<Configuration>
<AddAdmin>true</AddAdmin>
<AdminRole>admin</AdminRole>
<AdminUser>
<UserName>admin</UserName>
<Password>admin</Password>
</AdminUser>
<EveryOneRoleName>everyone</EveryOneRoleName>
<Property name=”isCascadeDeleteEnabled”>true</Property>
<Property name=”initializeNewClaimManager”>true</Property>
<Property name=”dataSource”>jdbc/WSO2UM_DB</Property>
</Configuration>
I'm using WSO2 ESB 4.6.0 and my configurations in axis2.xml are default:
<transportReceiver name="local" class="org.wso2.carbon.core.transports.local.CarbonLocalTransportReceiver"/>
<transportSender name="local" class="org.wso2.carbon.core.transports.local.CarbonLocalTransportSender"/>
Calling a proxy in the same JVM, when a fault occurs, the faultSequence can not return a response by the send mediator, and I receive a timeout.
The configuration below not solve my problem:
<faultSequence>
...
<header name="To" action="remove"/>
<property name="RESPONSE" value="true" scope="default" type="STRING"/>
<send/>
</faultSequence>
Otherwise, changing the 'local transport' by 'http transport', everything works well.
Any suggestion?
Try using the <respond/> mediator instead of the above to send the response back to client.
I did an upgrade to the ESB 4.9.0 version and I solved my problem. I saw some posts on internet like this and I think that is a bug in the old WSO2 version.
I am developing webservice using CXF. I use HTTP binding so according to http://www.w3.org/TR/wsdl#_soap:operation soapaction is mandatory for this type of transport.
The problem is that I want to deploy the same application for test and production server. I would like to do it without rebuilding application or keeping external WSDL files, which will add one more thing on maintenance list.
I had the same problem with location, but that one was trivial to solve. I used publishedEndpointUrl in endpoint configuration to set proper value. The value is retrieved during initialization of application from external property file, which I placed on classpath tomcat/common/classes .
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:soap="http://cxf.apache.org/bindings/soap" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:ws.properties</value>
</list>
</property>
</bean>
<jaxws:endpoint xmlns:tns="http://example.org/ds" id="ds" implementor="org.example.Ds" wsdlLocation="wsdl/ds.wsdl" endpointName="tns:dsSOAP" serviceName="tns:Ds" address="/dsSOAP" publishedEndpointUrl="${publishedEndpointUrl}">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature" />
</jaxws:features>
</jaxws:endpoint>
</beans>
I would like to achieve the same functionality for soapaction. The value for this attribute should be not relative URI. So for test it should be:
<soap:operation soapAction="https://test.example.org/dsSOAP/operation1" />
and for production
<soap:operation soapAction="https://example.org/dsSOAP/operation1" />
any idea how to achieve this?
You dont need to specify an absolute URL, you dont need either to specify a URL. "operation1" would be enough. See some official examples at http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
Linking the soap action with the environment the instance is running is not a "best practice".
I want to use method interceptors in spring 3 to accomplish logging in my app, so that I can trace which methods are called thru the app.
Is there a tutorial (or suggestion) on how to use method interceptors for logging in spring?
It would seem like something that has been done numerous times, but I have not been able to find much data on it.
The Spring reference has a whole chapter on Spring AOP that serves as a very detailed guide for doing what you're looking for. Try that, and if you have some more specific questions, ask.
Spring's org.springframework.aop.interceptor.CustomizableTraceInterceptor lets you achieve this out of the box.
You can customize the interceptor to your need to log argument and returned value of a method.
Example:-
<aop:config>
<aop:advisor advice-ref="loggingAdvisor"
pointcut="execution(public * com.x.y.z.AbstractCommand.*(..))" />
</aop:config>
<bean id="loggingAdvisor"
class="org.springframework.aop.interceptor.CustomizableTraceInterceptor">
<property name="loggerName" value="logger-name" />
<property name="enterMessage" value="Entering $[methodName]($[arguments])" />
<property name="exitMessage" value="Leaving $[methodName](): $[returnValue]" />
</bean>
Spring Document
Similiar SOF question answered