-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.1.X, 7.2.X, 7.3.X, Master
-
Fix Version/s: 7.1.10 DXP FP23, 7.1.10.6 SP6, 7.1.X, 7.2.10 DXP FP13, 7.2.X, 7.3.7 CE GA8, 7.3.10 DXP FP2, 7.3.X, 7.4.1 CE GA2, 7.4.13 DXP GA1, Master
-
Component/s: Application Security > OAuth
-
Branch Version/s:7.3.x, 7.2.x, 7.1.x
-
Backported to Branch:Committed
-
Fix Priority:3
-
Git Pull Request:
Steps to Reproduce:
- Start the portal.
- Execute the following command from the Gogo shell: scr:info com.liferay.oauth2.provider.rest.internal.endpoint.access.token.grant.handler.LiferayResourceOwnerAccessTokenGrantHandler
- Check that the ResourceOwnerLoginHandler is bound to com.liferay.oauth2.provider.rest
- Execute the script added at the end (the script adds a new ResourceOwnerLoginHandler with higher service ranking).
- Execute the following command from the Gogo shell: scr:info com.liferay.oauth2.provider.rest.internal.endpoint.access.token.grant.handler.LiferayResourceOwnerAccessTokenGrantHandler
Actual Results:
ResourceOwnerLoginHandler is still bound to com.liferay.oauth2.provider.rest
Expected Results:
ResourceOwnerLoginHandler should be bound to org.eclipse.osgi
- The script:
import com.liferay.registry.Registry; import com.liferay.registry.RegistryUtil; import java.util.Map; import java.util.HashMap; import com.liferay.registry.ServiceReference; Registry registry = RegistryUtil.getRegistry(); Map<String, Object> properties = new HashMap<>(); properties.put("service.ranking", 100); ServiceReference serviceReference = registry.getServiceReference("org.apache.cxf.rs.security.oauth2.grants.owner.ResourceOwnerLoginHandler"); def service = registry.getService(serviceReference); registry.registerService( "org.apache.cxf.rs.security.oauth2.grants.owner.ResourceOwnerLoginHandler", service, properties);