You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by pat7 <pa...@gmail.com> on 2018/08/06 09:08:50 UTC

Implementing Openid Connect with CXF

Hi,

I have a question about implementing openid connect with cxf and spring
boot.
I try to set up oidc without fediz. All configuration is done at the same
location. (server & service)

I start the flow using a browser and enter the jax-rs service url. I'm apply
a code-grant filter to protect the service and manage the re-directions
(OidcClientCodeRequestFilter).

After a user entered the service url, the browser redirect the user to
authenticate him with basic authentication (username + password). Works
fine.

Unfortunatelly, my service stop if I want to present the user an
authorization jsp form with a "RequestDispatcherProvider". 
I receive the following error msg...

2018-08-06 10:10:25.246  WARN 6200 --- [nio-8443-exec-9]
o.a.c.t.servlet.ServletController        : Can't find the the request for
https://localhost:8443/WEB-INF/Authorize.jsp's Observer 
2018-08-06 10:10:25.252  INFO 6200 --- [nio-8443-exec-9]
o.a.c.interceptor.LoggingOutInterceptor  : Outbound Message

My spring boot application contains a dictionary "src/main/webapp/WEB-INF"
and here is the authorization form (jsp) located.

Necessary Bean in the configuration class:

   @Bean
    public RequestDispatcherProvider authorizePage(){
    	RequestDispatcherProvider authorizeprovider = new
RequestDispatcherProvider();
    	authorizeprovider.setResourcePath("WEB-INF/Authorize.jsp");
    	return authorizeprovider;
    }

I added this Bean as a provider, where the authorize service beans are
located.

I think, that the server cannot find the authorization form. Unfortunatelly,
I do not know why this happen.

Do I miss something in my cxf configuration? 

Regards,
Patrick

 



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html

Re: Implementing Openid Connect with CXF

Posted by pat7 <pa...@gmail.com>.
Hi again,

another couple days later I solved my problem. It was a spring boot problem.
In combination with tomcat my project required 3 more dependencies to be
able to read jsp files. These are ... 

                 <dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.tomcat.embed</groupId>
			<artifactId>tomcat-embed-jasper</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jdt.core.compiler</groupId>
			<artifactId>ecj</artifactId>
			<version>4.6.1</version>
		</dependency>

Some of the above 3 dependencies conflicts with the
"cxf-spring-boot-starter-jaxws" and "cxf-spring-boot-starter-jaxrs"
dependencies and therefore, I replace them with "cxf-rt-frontend-jaxws" and
"cxf-rt-frontend-jaxrs".

Moreover, I added another property at the requestdispatcherprovider bean.

    @Bean
    public RequestDispatcherProvider authorizePage(){
    	  RequestDispatcherProvider authorizeprovider = new
RequestDispatcherProvider();
    	  authorizeprovider.setDispatcherName("jsp");
    	  authorizeprovider.setResourcePath("WEB-INF/Authorize.jsp");
    	  return authorizeprovider;
    }

After this changes, my project is able to handle jsp files.
Sorry for the inconveniences.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html