Discussion:
cxf and oauth2 configuration
Vassilis Virvilis
2018-08-28 10:24:15 UTC
Permalink
Hi,

I am taking the tutorial here http://cxf.apache.org/docs/jax-rs-oauth2.html

and I can't find a way to configure the dataProvider in the AccessTokenService class without Spring.

I am using the CXFNonSpringJaxrsServlet

I am currently using

public class MyAccessTokenService extends
org.apache.cxf.rs.security.oauth2.services.AccessTokenService {

public MyAccessTokenService() {
setDataProvider(new MyDataProvider());
}
}

Is there any other way that is officially endorsed?

Thanks in advance

Vassilis
Vassilis Virvilis
2018-08-28 10:24:47 UTC
Permalink
Hi,

I am taking the tutorial here http://cxf.apache.org/docs/jax-rs-oauth2.html

and I can't find a way to configure the dataProvider in the AccessTokenService class without Spring.

I am using the CXFNonSpringJaxrsServlet

I am currently using

public class MyAccessTokenService extends
org.apache.cxf.rs.security.oauth2.services.AccessTokenService {

public MyAccessTokenService() {
setDataProvider(new MyDataProvider());
}
}

Is there any other way that is officially endorsed?

Thanks in advance

Vassilis
Colm O hEigeartaigh
2018-08-30 15:38:20 UTC
Permalink
The documentation here says that there is a way that works for "simple"
properties:

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAX-RSservicesincontainerwithoutSpring

<param-value>
org.apache.cxf.systest.jaxrs.BookApplication
(name=1 id=2)
</param-value>

For your case however, the only other way I can think of is to pass the
name of the DataProvider as a "jaxrs.properties" property and load it in
your access token service implementation.

Colm.
Post by Vassilis Virvilis
Hi,
I am taking the tutorial here
http://cxf.apache.org/docs/jax-rs-oauth2.html
and I can't find a way to configure the dataProvider in the
AccessTokenService class without Spring.
I am using the CXFNonSpringJaxrsServlet
I am currently using
public class MyAccessTokenService extends
org.apache.cxf.rs.security.oauth2.services.AccessTokenService {
public MyAccessTokenService() {
setDataProvider(new MyDataProvider());
}
}
Is there any other way that is officially endorsed?
Thanks in advance
Vassilis
--
Colm O hEigeartaigh

Talend Community Coder
http://coders.talend.com
Loading...