LiQL using Java
I'm trying to use certain LiQL queries to retrieve community content and then publish as an internally (i.e., from the company network) accessible RSS feed. Right now, I'm retrieving feature content, which is easy enough; using the Studio API Broswer, I was able to construct my query and get results, which I was then able to also perform anonymously from the browser. I've been following instructions on the Getting Started page for this portion of work.
So once I accomplished that, I wrote a REST endpoint that performs an HTTP GET for this same content. The problem is that I receive a 401 Unauthorized response when I try from the code. I include the `client_id` query parameter, but the community API endpoint seemingly only allows anonymous query access from a browser, and obviously not from my code.
So, having read a couple of developer discussions on anonymous access, I don't think that's something I want to allow across the board. Even though an anonymous user wouldn't be able to access content for which they were not authenticated, this would open up the possibility of our community being scraped by bots, and that's not something we want.
So, with these considerations, it seems as though I need to be using the community authorization endpoint. And this is where things are breaking down for me. For reference, I'm using the OAuth 2.0 authorization grant flow article. First off, this isn't really a user accessing my REST endpoint. It'd be a request for the RSS feed, which before serving, the code would update with the latest featured topics, making the HTTP GET call to our community API endpoint. I don't understand how to supply the `callback_url` for this - where would I be calling back to? And I also don't want to really worry about any token expiring; it'd be preferrable to have an API key that I could use until it was manually expired or invalidated.
If someone could help walk me through this process a bit more, I'd appreciate it. Any insights into the authorization workflow or corrections of my current understanding are welcome. If others have accomplished similar feats, code examples would be great as well. Thanks in advance.