Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] using OslcOAuthClient

Hi Jim 

So as suspected, the current oauth libraries in Lyo seem to be focused on server-server communication (consumer-provider)

I think there must however be a scenario where one needs to include the User. 

A particular scenario I have is that an OSLC server (say a TestManagementSystem, acting as an OAuth Consumer) needs to show a selectionDialog from another OSLC server (say RequirmentsManagemeSystem, acting as an oauth Provider). 
Now, depending on the user credentials, not all Requirement Projects (hence ServiceProviders, hence SelectionDialogs) will be available to show to the end-user. 

I believe the Oauth Provider library in Lyo is fine. It is the Client library that might need to be extended to cover this need. 

I hope I can suggest an extension to existing code to see if I am on the right track. 


Regards 
Jad 


On 25 Jul 2017, at 17:16, Jim Amsden <jamsden@xxxxxxxxxx> wrote:

Jad,
When integrating an eclipse/Lyo based OSLC adapter to the jazz.net tools, OAuth is used to establish a conusmer/friend relationship between OSLC servers. This relationship is based on a consumer key provided by the provider server that is used in authentication with the consumer server (the one making the requests). The rootservices document URL is provided in this connection so that the consumer knows the OSLC discovery URLs for the provider.

So this represents a single connection between the consumer and provider OSLC servers, and is not associated with particular users.

The Bugzilla adapter stores session information in the HTTP session. See CredentialsFilter.doFilter().

                                HttpSession session= request.getSession();
                                BugzillaConnector connector= (BugzillaConnector) session
                                                .getAttribute(CONNECTOR_ATTRIBUTE);
                                if(connector== null) {
                                        try{
                                                Credentials credentials= (Credentials) request.getSession().getAttribute(CREDENTIALS_ATTRIBUTE);
                                                if(credentials== null)
                                                {
                                                        credentials= HttpUtils.getCredentials(request);
                                                        if(credentials== null) {
                                                                thrownewUnauthorizedException();
                                                        }
                                                }
                                                connector= getBugzillaConnector(credentials);
                                                session.setAttribute(CONNECTOR_ATTRIBUTE, connector);
                                                session.setAttribute(CREDENTIALS_ATTRIBUTE,
                                                        credentials);
                               
                                        } catch(UnauthorizedException e)


Jim Amsden, Senior Technical Staff Member
OSLC and Linked Lifecycle Data
919-525-6575




From:        Jad El-Khoury <jad@xxxxxx>
To:        Eclipse Lyo Dev List <lyo-dev@xxxxxxxxxxx>
Date:        07/24/2017 06:13 PM
Subject:        [lyo-dev] using OslcOAuthClient
Sent by:        lyo-dev-bounces@xxxxxxxxxxx




Hi
 
Does anyone have any experience in using the OslcOAuthClient (Lyo project org.eclipse.lyo.client) to handle an OAuth provider?
 
OslcOAuthClient seems to make sense when used in a simple java command-line application.
 
But, I cannot make it work from a web server (an OSLC server) that needs to handle tokens from multiple users.
OslcOAuthClient seems to handle a single OAuthAccessor accessor (it has a single protected accessor attribute), which is meant to represent a single user.
 
How can I make OslcOAuthClient handle multiple users?
 
Regards
______________________________
Jad El-khoury, PhD
KTH Royal Institute of Technology
School of Industrial Engineering and Management, Mechatronics Division
Brinellvägen 83, SE-100 44 Stockholm, Sweden
Phone: +46(0)8 790 6877 Mobile: +46(0)70 773 93 45
jad@xxxxxx, www.kth.se
 _______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/lyo-dev


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/lyo-dev

Back to the top