I am using the Keycloak Quickstart app-authz-springboot to delegate all the authorization
to Keycloak server,
https://github.com/keycloak/keycloak-quickstarts/tree/latest/app-authz-sp...
If I do mvn spring-boot:run into the project, and I put localhost:8080 it redirects to
Spring login instead of the keycloak one. I read in other issues that including the
web.xml into the project it solves it, but it returns me the next error,
[ERROR] Failed to execute goal
org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:run (default-cli) on
project login-focusoc-web: Application finished with exit code: 1 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.springframework.boot:spring-boot-maven-plugin:2.2.0.RELEASE:run (default-cli) on
project login-focusoc-web: Application finished with exit code: 1 at
org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117) at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81) at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56) at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at
org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at
org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at
org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at
org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at
org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke
(Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:347) Caused by: org.apache.maven.plugin.MojoExecutionException: Application
finished with exit code: 1 at org.springframework.boot.maven.RunMojo.runWithForkedJvm
(RunMojo.java:108) at org.springframework.boot.maven.AbstractRunMojo.doRunWithForkedJvm
(AbstractRunMojo.java:284) at org.springframework.boot.maven.AbstractRunMojo.run
(AbstractRunMojo.java:249) at org.springframework.boot.maven.AbstractRunMojo.execute
(AbstractRunMojo.java:205) at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo
(DefaultBuildPluginManager.java:137) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:117) at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject
(LifecycleModuleBuilder.java:81) at
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build
(SingleThreadedBuilder.java:56) at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at
org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at
org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at
org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at
org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at
org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at
jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke
(Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced
(Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch
(Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode
(Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main
(Launcher.java:347)
The web.xml I added is,
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<module-name>login-provider-web</module-name>
<login-config>
<auth-method>KEYCLOAK</auth-method>
<realm-name>FocusocKeycloak</realm-name>
</login-config>
<security-role>
<role-name>ROLE_USER</role-name>
</security-role>
</web-app>
Anyone can help me?
P Please consider the environment before printing this e-mail.