<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>7.1 Rest example not working.</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112477962" />
  <subtitle>7.1 Rest example not working.</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=112477962</id>
  <updated>2026-04-06T04:00:02Z</updated>
  <dc:date>2026-04-06T04:00:02Z</dc:date>
  <entry>
    <title>RE: 7.1 Rest example not working.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119701572" />
    <author>
      <name>Vishal Shah</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119701572</id>
    <updated>2020-08-04T08:55:41Z</updated>
    <published>2020-08-04T08:55:41Z</published>
    <summary type="html">Hi,You can check with blade sample example from below URL : &lt;a href="https://github.com/liferay/liferay-blade-samples/tree/7.1/liferay-workspace/apps/rest"&gt;https://github.com/liferay/liferay-blade-samples/tree/7.1/liferay-workspace/apps/rest&lt;/a&gt;&lt;br /&gt;For this rest services, just check properly Gradle sync with their dependencies. </summary>
    <dc:creator>Vishal Shah</dc:creator>
    <dc:date>2020-08-04T08:55:41Z</dc:date>
  </entry>
  <entry>
    <title>RE: 7.1 Rest example not working.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112534343" />
    <author>
      <name>Mike Perico</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112534343</id>
    <updated>2019-03-01T14:47:57Z</updated>
    <published>2019-03-01T14:47:57Z</published>
    <summary type="html">Has anyone successfully gotten the JAX-RS example working with liferay 7.1 GA3?&lt;br /&gt;&lt;br /&gt;example: &lt;a href="https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/jax-rs"&gt;https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/jax-rs&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If someone can try to see if this works for them, it would be appreciated. It should only take about 5 minutes to verify.</summary>
    <dc:creator>Mike Perico</dc:creator>
    <dc:date>2019-03-01T14:47:57Z</dc:date>
  </entry>
  <entry>
    <title>7.1 Rest example not working.</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112477961" />
    <author>
      <name>Mike Perico</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=112477961</id>
    <updated>2019-02-26T18:45:53Z</updated>
    <published>2019-02-26T18:45:53Z</published>
    <summary type="html">Hello,&lt;br /&gt;&lt;br /&gt; I have tried the example at: &lt;a href="https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/jax-rs"&gt;https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-1/jax-rs&lt;/a&gt;&lt;br /&gt; I was unable to get this to work using 7.1 GA3 and 7.1 GA 1. I also had two other co-workers tried this example with the same result. I built the stock example using gradlew.  I didn&amp;#39;t add any additional code to the file that was generated after choosing Liferay Module Project (see attached file). I deployed the jar using the deploy directory. &lt;br /&gt;&lt;br /&gt;I then went to &lt;em&gt;Control Panel&lt;/em&gt; → &lt;em&gt;Configuration&lt;/em&gt; → &lt;em&gt;OAuth2 Administration  &lt;/em&gt;to finish up  the configuration. I grabbed the client id and secret to get the bearer token.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I was able to get the bearer token as seen here:&lt;br /&gt;&lt;br /&gt;$ curl http://localhost:8080/o/oauth2/token -d &amp;#39;grant_type=client_credentials&amp;amp;client_id=id-97bb1294-99f4-4f17-8f02-6f835186d&amp;amp;client_secret=secret-5e421c7c-c453-af56-3e79-b86c61bc151f&amp;#39;&lt;br /&gt;{&amp;#34;access_token&amp;#34;:&amp;#34;9e439dc87cc4f167c4aefb9c97182846db7962da6981fb5c6779f9b4d83f1b&amp;#34;,&amp;#34;token_type&amp;#34;:&amp;#34;Bearer&amp;#34;,&amp;#34;expires_in&amp;#34;:600}&lt;br /&gt;&lt;br /&gt;When I tried to access the rest endpoint I do not get the correct message back, it just seems to be consumed as seen here:&lt;br /&gt;&lt;br /&gt;mperico@Mikes-Mac:~/liferay7/rest-example/build/libs&lt;br /&gt;$ curl --header &amp;#34;Authorization: Bearer 9e439dc87cc4f167c4aefb9c97182846db7962da6981fb5c6779f9b4d83f1b&amp;#34; http://localhost:8080/o/greetings/morning&lt;br /&gt;&lt;br /&gt;mperico@Mikes-Mac:~/liferay7/rest-example/build/libs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;As you can see, I do not get back the appropriate greeting, which should be &amp;#34;Good morning!&amp;#34;&lt;br /&gt;&lt;br /&gt;If I delete some characters from the bearer token, I do get the correct error message (403)from the service, so something must be working. &lt;br /&gt;&lt;br /&gt;mperico@Mikes-Mac:~/liferay7/rest-example/build/libs&lt;br /&gt;$ curl --header &amp;#34;Authorization: Bearer 9e439dc87cc4f167c4aefb9c97182846db7962da6981fb5c6779f9b4d83f1&amp;#34; http://localhost:8080/o/greetings/gggg/ggg&lt;br /&gt;&amp;lt;!doctype html&amp;gt;&amp;lt;html lang=&amp;#34;en&amp;#34;&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;HTTP Status 403 &amp;#8211; Forbidden&amp;lt;/title&amp;gt;&amp;lt;style type=&amp;#34;text/css&amp;#34;&amp;gt;h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color&lt;img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" &gt;525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color&lt;img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" &gt;525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color&lt;img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" &gt;525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color&lt;img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" &gt;525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color&lt;img alt="emoticon" src="@theme_images_path@/emoticons/kiss.gif" &gt;525D76;border:none;}&amp;lt;/style&amp;gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;h1&amp;gt;HTTP Status 403 &amp;#8211; Forbidden&amp;lt;/h1&amp;gt;&amp;lt;hr class=&amp;#34;line&amp;#34; /&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Type&amp;lt;/b&amp;gt; Status Report&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Message&amp;lt;/b&amp;gt; Authorization required&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;Description&amp;lt;/b&amp;gt; The server understood the request but refuses to authorize it.&amp;lt;/p&amp;gt;&amp;lt;hr class=&amp;#34;line&amp;#34; /&amp;gt;&amp;lt;h3&amp;gt;Apache Tomcat/9.0.6&amp;lt;/h3&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;What do I need to do to get this to work properly?</summary>
    <dc:creator>Mike Perico</dc:creator>
    <dc:date>2019-02-26T18:45:53Z</dc:date>
  </entry>
</feed>
