jrcampins

Bearer-only not allowed

Mar 17th, 2022 (edited)
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.96 KB | None | 0 0
  1. cd C:\Users\jrcam\proyecto-adalid\local-adalid-jee2\jax-rs-client; "MAVEN_OPTS=-Djansi.passthrough=true -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -Dorg.slf4j.simpleLogger.log.org.netbeans.modules.maven.event=off" "JAVA_HOME=C:\\Program Files\\Java\\jdk-11.0.13" cmd /c "\"C:\\Program Files\\NetBeans-12.6\\netbeans\\java\\maven\\bin\\mvn.cmd\" \"-Dexec.args=-classpath %classpath xyz2.BarrioFacadeClient\" \"-Dexec.executable=C:\\Program Files\\Java\\jdk-11.0.13\\bin\\java.exe\" -Dexec.classpathScope=test -Dexec.vmArgs= -Dexec.appArgs= \"-Dmaven.ext.class.path=C:\\Program Files\\NetBeans-12.6\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 -Djansi.passthrough=true org.codehaus.mojo:exec-maven-plugin:3.0.0:exec"
  2. Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
  3. 17-03-22 13:09:49 | INFO | L010 | Authentication mechanism: Bearer Token Authorization
  4. 17-03-22 13:09:50 | DEBUG | RequestAddCookies | CookieSpec selected: default
  5. 17-03-22 13:09:50 | DEBUG | RequestAuthCache | Auth cache not set in the context
  6. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection request: [route: {}->http://localhost:8180][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
  7. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection leased: [id: 0][route: {}->http://localhost:8180][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
  8. 17-03-22 13:09:50 | DEBUG | MainClientExec | Opening connection {}->http://localhost:8180
  9. 17-03-22 13:09:50 | DEBUG | DefaultHttpClientConnectionOperator | Connecting to localhost/127.0.0.1:8180
  10. 17-03-22 13:09:50 | DEBUG | DefaultHttpClientConnectionOperator | Connection established 127.0.0.1:64654<->127.0.0.1:8180
  11. 17-03-22 13:09:50 | DEBUG | MainClientExec | Executing request GET /auth/realms/jrcam/.well-known/uma2-configuration HTTP/1.1
  12. 17-03-22 13:09:50 | DEBUG | MainClientExec | Target auth state: UNCHALLENGED
  13. 17-03-22 13:09:50 | DEBUG | MainClientExec | Proxy auth state: UNCHALLENGED
  14. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> GET /auth/realms/jrcam/.well-known/uma2-configuration HTTP/1.1
  15. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Host: localhost:8180
  16. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Connection: Keep-Alive
  17. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5 (Java/11.0.13)
  18. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Accept-Encoding: gzip,deflate
  19. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "GET /auth/realms/jrcam/.well-known/uma2-configuration HTTP/1.1[\r][\n]"
  20. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Host: localhost:8180[\r][\n]"
  21. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
  22. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5 (Java/11.0.13)[\r][\n]"
  23. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
  24. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "[\r][\n]"
  25. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "HTTP/1.1 200 OK[\r][\n]"
  26. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Cache-Control: no-cache, must-revalidate, no-transform, no-store[\r][\n]"
  27. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
  28. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "X-Frame-Options: SAMEORIGIN[\r][\n]"
  29. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Referrer-Policy: no-referrer[\r][\n]"
  30. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Date: Thu, 17 Mar 2022 17:09:50 GMT[\r][\n]"
  31. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Connection: keep-alive[\r][\n]"
  32. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]"
  33. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
  34. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Content-Type: application/json[\r][\n]"
  35. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Content-Length: 1836[\r][\n]"
  36. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "[\r][\n]"
  37. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "{"issuer":"http://localhost:8180/auth/realms/jrcam","authorization_endpoint":"http://localhost:8180/auth/realms/jrcam/protocol/openid-connect/auth","token_endpoint":"http://localhost:8180/auth/realms/jrcam/protocol/openid-connect/token","introspection_endpoint":"http://localhost:8180/auth/realms/jrcam/protocol/openid-connect/token/introspect","end_session_endpoint":"http://localhost:8180/auth/realms/jrcam/protocol/openid-connect/logout","frontchannel_logout_session_supported":true,"frontchannel_logout_supported":true,"jwks_uri":"http://localhost:8180/auth/realms/jrcam/protocol/openid-connect/certs","grant_types_supported":["authorization_code","implicit","refresh_token","password","client_credentials","urn:ietf:params:oauth:grant-type:device_code","urn:openid:params:grant-type:ciba"],"response_types_supported":["code","none","id_token","token","id_token token","code id_token","code token","code id_token token"],"response_modes_supported":["query","fragment","form_post","query.jwt","fragment.jwt","form_post.jwt","jwt"],"registration_endpoint":"http://localhost:8180/auth/realms/jrcam/clients-registrations/openid-connect","token_endpoint_auth_methods_supported":["private_key_jwt","client_secret_basic","client_secret_post","tls_client_auth","client_secret_jwt"],"token_endpoint_auth_signing_alg_values_supported":["PS384","ES384","RS384","HS256","HS512","ES256","RS256","HS384","ES512","PS256","PS512","RS512"],"scopes_supported":["openid","roles","phone","web-origins","email","profile","microprofile-jwt","address","offline_access"],"resource_registration_endpoint":"http://localhost:8180/auth/realms/jrcam/authz/protection/resource_set","permission_endpoint":"http://localhost:8180/auth/realms/jrcam/authz/protection/permission","policy_endpoint":"http://localhost:8180/auth/realms/jrcam/authz/protection/uma-policy"}"
  38. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << HTTP/1.1 200 OK
  39. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Cache-Control: no-cache, must-revalidate, no-transform, no-store
  40. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << X-XSS-Protection: 1; mode=block
  41. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << X-Frame-Options: SAMEORIGIN
  42. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Referrer-Policy: no-referrer
  43. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Date: Thu, 17 Mar 2022 17:09:50 GMT
  44. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Connection: keep-alive
  45. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Strict-Transport-Security: max-age=31536000; includeSubDomains
  46. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << X-Content-Type-Options: nosniff
  47. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Content-Type: application/json
  48. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Content-Length: 1836
  49. 17-03-22 13:09:50 | DEBUG | MainClientExec | Connection can be kept alive indefinitely
  50. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection [id: 0][route: {}->http://localhost:8180] can be kept alive indefinitely
  51. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection released: [id: 0][route: {}->http://localhost:8180][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
  52. 17-03-22 13:09:50 | DEBUG | logging | Logging Provider: org.jboss.logging.Log4jLoggerProvider
  53. 17-03-22 13:09:50 | DEBUG | RequestAddCookies | CookieSpec selected: default
  54. 17-03-22 13:09:50 | DEBUG | RequestAuthCache | Auth cache not set in the context
  55. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection request: [route: {}->http://localhost:8180][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
  56. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection leased: [id: 0][route: {}->http://localhost:8180][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 20]
  57. 17-03-22 13:09:50 | DEBUG | MainClientExec | Executing request POST /auth/realms/jrcam/protocol/openid-connect/token HTTP/1.1
  58. 17-03-22 13:09:50 | DEBUG | MainClientExec | Proxy auth state: UNCHALLENGED
  59. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> POST /auth/realms/jrcam/protocol/openid-connect/token HTTP/1.1
  60. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Authorization: Basic eHl6MmFwMTEyLXdlYi1hcGk6TXlrZVhnMkdicjNZZ1hqamozZmw4OVlmNDFiQ2J3WnI=
  61. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Content-Length: 50
  62. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
  63. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Host: localhost:8180
  64. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Connection: Keep-Alive
  65. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> User-Agent: Apache-HttpClient/4.5 (Java/11.0.13)
  66. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 >> Accept-Encoding: gzip,deflate
  67. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "POST /auth/realms/jrcam/protocol/openid-connect/token HTTP/1.1[\r][\n]"
  68. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Authorization: Basic eHl6MmFwMTEyLXdlYi1hcGk6TXlrZVhnMkdicjNZZ1hqamozZmw4OVlmNDFiQ2J3WnI=[\r][\n]"
  69. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Content-Length: 50[\r][\n]"
  70. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1[\r][\n]"
  71. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Host: localhost:8180[\r][\n]"
  72. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Connection: Keep-Alive[\r][\n]"
  73. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "User-Agent: Apache-HttpClient/4.5 (Java/11.0.13)[\r][\n]"
  74. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "Accept-Encoding: gzip,deflate[\r][\n]"
  75. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "[\r][\n]"
  76. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 >> "password=sesamo&grant_type=password&username=jorge"
  77. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "HTTP/1.1 400 Bad Request[\r][\n]"
  78. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Cache-Control: no-store[\r][\n]"
  79. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "X-XSS-Protection: 1; mode=block[\r][\n]"
  80. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Pragma: no-cache[\r][\n]"
  81. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "X-Frame-Options: SAMEORIGIN[\r][\n]"
  82. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Referrer-Policy: no-referrer[\r][\n]"
  83. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Date: Thu, 17 Mar 2022 17:09:50 GMT[\r][\n]"
  84. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Connection: keep-alive[\r][\n]"
  85. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]"
  86. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "X-Content-Type-Options: nosniff[\r][\n]"
  87. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Content-Type: application/json[\r][\n]"
  88. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "Content-Length: 72[\r][\n]"
  89. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "[\r][\n]"
  90. 17-03-22 13:09:50 | DEBUG | wire | http-outgoing-0 << "{"error":"invalid_client","error_description":"Bearer-only not allowed"}"
  91. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << HTTP/1.1 400 Bad Request
  92. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Cache-Control: no-store
  93. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << X-XSS-Protection: 1; mode=block
  94. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Pragma: no-cache
  95. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << X-Frame-Options: SAMEORIGIN
  96. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Referrer-Policy: no-referrer
  97. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Date: Thu, 17 Mar 2022 17:09:50 GMT
  98. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Connection: keep-alive
  99. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Strict-Transport-Security: max-age=31536000; includeSubDomains
  100. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << X-Content-Type-Options: nosniff
  101. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Content-Type: application/json
  102. 17-03-22 13:09:50 | DEBUG | headers | http-outgoing-0 << Content-Length: 72
  103. 17-03-22 13:09:50 | DEBUG | MainClientExec | Connection can be kept alive indefinitely
  104. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection [id: 0][route: {}->http://localhost:8180] can be kept alive indefinitely
  105. 17-03-22 13:09:50 | DEBUG | PoolingHttpClientConnectionManager | Connection released: [id: 0][route: {}->http://localhost:8180][total kept alive: 1; route allocated: 1 of 2; total allocated: 1 of 20]
  106. Exception in thread "main" java.lang.RuntimeException: Failed to obtain authorization data
  107. at org.keycloak.authorization.client.util.Throwables.retryAndWrapExceptionIfNecessary(Throwables.java:91)
  108. at org.keycloak.authorization.client.resource.AuthorizationResource.authorize(AuthorizationResource.java:98)
  109. at org.xyz.jax.rs.client.util.KeycloakUtils.getRequestingPartyToken(KeycloakUtils.java:51)
  110. at org.xyz.jax.rs.client.base.AbstractServiceClient.setUsernamePassword(AbstractServiceClient.java:52)
  111. at org.xyz.jax.rs.client.base.AbstractServiceClient.build(AbstractServiceClient.java:37)
  112. at org.xyz.jax.rs.client.base.AbstractFacadeServiceClient.build(AbstractFacadeServiceClient.java:23)
  113. at xyz2.BarrioFacadeClient.init(BarrioFacadeClient.java:35)
  114. at xyz2.BarrioFacadeClient.<init>(BarrioFacadeClient.java:31)
  115. at xyz2.BarrioFacadeClient.main(BarrioFacadeClient.java:23)
  116. Caused by: org.keycloak.authorization.client.util.HttpResponseException: Unexpected response from server: 400 / Bad Request / Response from server: {"error":"invalid_client","error_description":"Bearer-only not allowed"}
  117. at org.keycloak.authorization.client.util.HttpMethod.execute(HttpMethod.java:95)
  118. at org.keycloak.authorization.client.util.HttpMethodResponse$2.execute(HttpMethodResponse.java:50)
  119. at org.keycloak.authorization.client.util.TokenCallable.obtainAccessToken(TokenCallable.java:135)
  120. at org.keycloak.authorization.client.util.TokenCallable.call(TokenCallable.java:59)
  121. at org.keycloak.authorization.client.resource.AuthorizationResource$1.call(AuthorizationResource.java:84)
  122. at org.keycloak.authorization.client.resource.AuthorizationResource$1.call(AuthorizationResource.java:74)
  123. at org.keycloak.authorization.client.resource.AuthorizationResource.authorize(AuthorizationResource.java:96)
  124. ... 7 more
  125. [ERROR] Command execution failed.
  126. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
  127. at org.apache.commons.exec.DefaultExecutor.executeInternal (DefaultExecutor.java:404)
  128. at org.apache.commons.exec.DefaultExecutor.execute (DefaultExecutor.java:166)
  129. at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:982)
  130. at org.codehaus.mojo.exec.ExecMojo.executeCommandLine (ExecMojo.java:929)
  131. at org.codehaus.mojo.exec.ExecMojo.execute (ExecMojo.java:457)
  132. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
  133. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
  134. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
  135. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
  136. at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
  137. at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
  138. at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
  139. at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
  140. at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
  141. at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
  142. at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
  143. at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
  144. at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
  145. at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
  146. at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
  147. at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
  148. at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
  149. at java.lang.reflect.Method.invoke (Method.java:566)
  150. at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
  151. at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
  152. at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
  153. at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  154. [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0:exec (default-cli) on project jax-rs-client: Command execution failed.: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
  155. [ERROR]
  156. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  157. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  158. [ERROR]
  159. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  160. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  161.  
Advertisement
Add Comment
Please, Sign In to add comment