<?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>GraphQL response when access denied</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117953372" />
  <subtitle>GraphQL response when access denied</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=117953372</id>
  <updated>2026-04-04T14:13:34Z</updated>
  <dc:date>2026-04-04T14:13:34Z</dc:date>
  <entry>
    <title>RE: GraphQL response when access denied</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117965568" />
    <author>
      <name>Jack Bakker</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117965568</id>
    <updated>2019-12-03T23:42:05Z</updated>
    <published>2019-12-03T23:42:05Z</published>
    <summary type="html">Sounds good. Let me know if I can help.</summary>
    <dc:creator>Jack Bakker</dc:creator>
    <dc:date>2019-12-03T23:42:05Z</dc:date>
  </entry>
  <entry>
    <title>RE: GraphQL response when access denied</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117963138" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117963138</id>
    <updated>2019-12-03T20:09:32Z</updated>
    <published>2019-12-03T20:09:32Z</published>
    <summary type="html">Whoa... I didn&amp;#39;t know that there were well though solutions outside of the standard. Will take a look &lt;img alt="emoticon" src="@theme_images_path@/emoticons/happy.gif" &gt;</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2019-12-03T20:09:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: GraphQL response when access denied</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117962799" />
    <author>
      <name>Jack Bakker</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117962799</id>
    <updated>2019-12-03T20:07:21Z</updated>
    <published>2019-12-03T20:07:21Z</published>
    <summary type="html">I&amp;#39;ve been looking at what others do in the way of error codes in GraphQL responses, for example: &lt;a href="https://www.apollographql.com/docs/apollo-server/data/errors/"&gt;https://www.apollographql.com/docs/apollo-server/data/errors/&lt;/a&gt; ; I think this will take some planning</summary>
    <dc:creator>Jack Bakker</dc:creator>
    <dc:date>2019-12-03T20:07:21Z</dc:date>
  </entry>
  <entry>
    <title>RE: GraphQL response when access denied</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117962461" />
    <author>
      <name>Javier Gamarra</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117962461</id>
    <updated>2019-12-03T20:00:20Z</updated>
    <published>2019-12-03T20:00:20Z</published>
    <summary type="html">Mmm... GraphQL default behaviour is returning 200 and reading the errors block but it&amp;#39;s true that it&amp;#39;s hard to parse without an error code, I&amp;#39;ll see if I can add it to the default error object.</summary>
    <dc:creator>Javier Gamarra</dc:creator>
    <dc:date>2019-12-03T20:00:20Z</dc:date>
  </entry>
  <entry>
    <title>GraphQL response when access denied</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117953371" />
    <author>
      <name>Jack Bakker</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=117953371</id>
    <updated>2019-12-02T23:04:28Z</updated>
    <published>2019-12-02T23:04:28Z</published>
    <summary type="html">in v7.2 GA2, I am exploring auth flow from a decoupled frontend app while also testing in the Altair Chrome extension&lt;br /&gt;&lt;br /&gt;I have a GraphQL query:&lt;br /&gt;&lt;br /&gt;query {&lt;br /&gt;  structuredContent(structuredContentId: 34612) {&lt;br /&gt;    title&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;If Liferay allows access based on Authorization header, I get back correctly the StructuredContent. However if I don&amp;#39;t pass in a Authorization header at all, Liferay does not allow access and the following is returned with response code 200 OK:&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;  &amp;#34;data&amp;#34;: {&lt;br /&gt;    &amp;#34;structuredContent&amp;#34;: null&lt;br /&gt;  },&lt;br /&gt;  &amp;#34;errors&amp;#34;: [&lt;br /&gt;    {&lt;br /&gt;      &amp;#34;extensions&amp;#34;: null,&lt;br /&gt;      &amp;#34;message&amp;#34;: &amp;#34;Exception while fetching data (/structuredContent) : java.lang.SecurityException: Access denied to com.liferay.journal.service.JournalArticleService#getLatestArticle&amp;#34;,&lt;br /&gt;      &amp;#34;path&amp;#34;: null&lt;br /&gt;    }&lt;br /&gt;  ]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;I am rather new to GraphQL with auth and in the frontend app I want to choose to send the user to a login or display something useful if user is not authorized. Are there no error codes in the response ?</summary>
    <dc:creator>Jack Bakker</dc:creator>
    <dc:date>2019-12-02T23:04:28Z</dc:date>
  </entry>
</feed>
