Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mylar-dev] Authentication problems

Hi Klaas,

Glad that got you started. :)

I've revisited your initial question in some detail, because my work
took me in that direction.  The reason your code was failing, is because
the TaskRepository backends the authentication information in the
eclipse keychain. (Advantage: security).

This is a bit of a stab in the dark, but I'm going to guess you were
running the bugzilla library without the eclipse workbench (ie:
org.eclipse.core's Activator hasn't been invoked).  When running with
the eclipse workbench the code you were working with initially should work.

For info about headless eclipse (if that's useful to you, check out the
equinox incubator: http://www.eclipse.org/equinox/incubator/server/)

Cheers,
Nathan

Klaas_Bals@xxxxxxxxxxxxxxxxxxxxxx wrote:
> 
> Nathan,
> 
> Thanks a lot. It works, and it is exacltly the usecase I had: retrieve 
> information about speicifc bugids.
> 
> Thanks a lot for your quick response, and keep up the good work with 
> Mylar. It looks very promising!
> -----
> Klaas Bals  -  CTO
> Inventive Designers
> Direct Phone: +32 - 3 - 8210183
> Office Phone: +32 - 3 - 8210170
> Office Fax: +32 - 3 - 8210171
> Email: Klaas_Bals@xxxxxxxxxxxxxxxxxxxxxx
> http://www.inventivedesigners.com
> 
> Inventive Designers - Keep your options open...
> 
> 
> 
> 
> 
> *Nathan Hapke <nhapke@xxxxxxxxx>*
> Sent by: mylar-dev-bounces@xxxxxxxxxxx
> 
> 07/08/2006 23:08
> Please respond to
> Mylar developer discussions <mylar-dev@xxxxxxxxxxx>
> 
> 
> 	
> To
> 	Mylar developer discussions <mylar-dev@xxxxxxxxxxx>
> cc
> 	
> Subject
> 	Re: [mylar-dev] Authentication problems
> 
> 
> 	
> 
> 
> 
> 
> 
> Hi Klaas,
> 
> Try the following instead:
> 
> RepositoryTaskData task = BugzillaServerFacade.getBug(repositoryUrl,
> userName, password, proxySettings, characterEncoding, id);
> 
> Then you can do stuff like:
> 
> System.out.println(task.getAssignedTo());
> System.out.println(task.getDescription());
> System.out.println(task.getLabel());
> System.out.println(task.getLastModified());
> System.out.println(task.getRepositoryKind());
> ...etc...
> 
> In my quick little test, the characterEncoding and proxySettings can be
> null.
> 
> Your plugin will need to depend on org.eclipse.mylar.bugzilla.core AND
> org.eclipse.mylar.tasks.core
> 
> Also FYI, AbstractRepositoryConnector (and the corresponding
> BugzillaRepositoryConnector) will be refactored into the headless core
> when Mik gets back. [https://bugs.eclipse.org/bugs/show_bug.cgi?id=150290]
> 
> Hope this helps,
> Nathan
> 
> P.S.: I'll add this information to:
> http://wiki.eclipse.org/index.php/Mylar_Integrator_Reference
> 
> Klaas_Bals@xxxxxxxxxxxxxxxxxxxxxx wrote:
>  >
>  > I'm trying to use the bugzilla classes to access a bugzilla repository.
>  > I've sucessfully ran the BugzillaQueryTest.
>  >
>  > Now I'm trying to access our own bugzilla, using a username and
>  > password. To access the repository, I have the following lines of code:
>  >
>  >                 fRepository=*new*
>  > TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, repositoryURL,
>  > IBugzillaConstants.BugzillaServerVersion.SERVER_218.toString());
>  >                 fRepository.setAuthenticationCredentials(username,
>  > password);
>  >                 System.out.println(fRepository.getUserName());
>  >                 System.out.println(fRepository.getPassword());
>  >
>  > As output, I get 'null' twice, which means that the authentication
>  > information is not set. If I trace down to
>  > TaskRepository.setAuthenticationCredentials into getAuthInfo(), I find
>  > that Platform.getAuthorizationInfo() always returns null.
>  >
>  > If I continue, and do try to run a search, I get the resulting status
>  > message:
>  > Status ERROR: org.eclipse.mylar.bugzilla.ui code=4 Login error occurred
>  > while querying Bugzilla Server http://bugs.intranet.
>  > Ensure proper configuration in Task Repositories View.
>  > _javax.security.auth.login.LoginException_: Invalid Username Or Password
>  > children=[Status ERROR: org.eclipse.mylar.bugzilla.ui code=4 class
>  > _javax.security.auth.login.LoginException_:  
>  > _javax.security.auth.login.LoginException_: Invalid Username Or Password
>  > Status ERROR: org.eclipse.mylar.bugzilla.ui code=0 search failed
>  > _javax.security.auth.login.LoginException_: Invalid Username Or Password]
>  >
>  > Any thoughts?
>  >
>  > Thanks!
>  > -----
>  > Klaas Bals  -  CTO
>  > Inventive Designers
>  > Direct Phone: +32 - 3 - 8210183
>  > Office Phone: +32 - 3 - 8210170
>  > Office Fax: +32 - 3 - 8210171
>  > Email: Klaas_Bals@xxxxxxxxxxxxxxxxxxxxxx
>  > http://www.inventivedesigners.com
>  >
>  > Inventive Designers - Keep your options open...
>  >
>  >
>  > ------------------------------------------------------------------------
>  >
>  > Inventive Designers' Email Disclaimer:
>  > http://www.inventivedesigners.com/email-disclaimer
>  >
>  >
>  >
>  > ------------------------------------------------------------------------
>  >
>  > _______________________________________________
>  > mylar-dev mailing list
>  > mylar-dev@xxxxxxxxxxx
>  > https://dev.eclipse.org/mailman/listinfo/mylar-dev
> _______________________________________________
> mylar-dev mailing list
> mylar-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylar-dev
> 
> ------------------------------------------------------------------------
> 
> Inventive Designers' Email Disclaimer:
> http://www.inventivedesigners.com/email-disclaimer
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mylar-dev mailing list
> mylar-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/mylar-dev



Back to the top