javaeclipse-plugineclipse-rcpequinoxp2

How to authenticate update site in eclipse-rcp


How can I authenticate update site url when accessed through web or rcp application(version 3.x and 4.x).

Referred URL: https://www.eclipse.org/forums/index.php/t/1093851/ and https://www.eclipsezone.com/eclipse/forums/t106640.html

In 1st url question it is mentioned use of LoginDialog (org.eclipse.equinox.internal.p2.ui.dialogs.UserValidationDialog) but I am not aware how to use it in code.

I also followed steps mentioned in 2nd url but unable to get any dialog.

Please find below image links with 4 steps mentioned with numbers and I want authentication dialog between steps 3 and 4

Image with steps 1 and 2

Image with step 3

Image with step 4


Solution

  • From referred URL https://www.eclipse.org/forums/index.php/t/1093851/

    p2 uses the OSGi Services mechanism to find services. You'll want to provide an implementation of the org.eclipse.equinox.p2.core.UIServices;

    Try to add "org.eclipse.equinox.p2.ui" with its dependencies to your RCP, this bundle registers the public class ValidationDialogServiceUI extends UIServices that uses org.eclipse.equinox.internal.p2.ui.dialogs.UserValidationDialog