Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-130819

LiferayResourceOwnerAccessTokenGrantHandler._resourceOwnerLoginHandler field cannot be overriden

    Details

      Description

      Steps to Reproduce:

      1. Start the portal.
      2. Execute the following command from the Gogo shell: scr:info com.liferay.oauth2.provider.rest.internal.endpoint.access.token.grant.handler.LiferayResourceOwnerAccessTokenGrantHandler
      3. Check that the ResourceOwnerLoginHandler is bound to com.liferay.oauth2.provider.rest
      4. Execute the script added at the end (the script adds a new ResourceOwnerLoginHandler with higher service ranking).
      5. 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);
        
        

        Attachments

          Activity

            People

            Assignee:
            marta.medio Marta Medio (Inactive)
            Reporter:
            mariano.alvaro Mariano Álvaro
            Participants of an Issue:
            Recent user:
            Clarissa Velazquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              21 weeks, 6 days ago

                Packages

                Version Package
                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 DXP 7,4
                Master