• Content count

  • Joined

  • Last visited

About wile_e8

  • Rank

Recent Profile Visitors

667 profile views
  1. wile_e8

    Server Changes?

    Thanks. Everything fine after updating OkHttp.
  2. wile_e8

    Server Changes?

    Sorry, haven't gotten much of a chance to debug this yet. I'm using Retrofit, and from what I can tell my request for a token comes back with an error "Expected ':status' header not present". I don't know exactly what is going wrong, but I don't have the time to check into it more tonight. But I know I had the headers working fine before this weekend, so maybe that can give you a hint as to what changes broke my app.
  3. wile_e8

    Server Changes?

    Has there been a server update that changed the public API? My app, which had been working fine with Inoreader for years, suddenly stopped working over the weekend. I kept getting server read errors when trying to browse through the app as usual, and when I tried to re-login to see if renewing credentials would fix the problem I could no longer login through OAuth. I haven't made any changes to my app for a while, so the sudden appearance of errors seems to indicate something changed on the server side. Was something changed? Did my app get blocked for some reason?
  4. wile_e8

    Oauth Errors - HTTP 400 Bad Request

    I had implemented OAuth using http://localhost in a WebView in my client, but then I came across a post pointing out that doing OAuth in a WebView is a bad practice and that I should send the user to a browser to enter their password. Getting back to my app in Android after the user grants permission in a browser window requires setting intent filter to detect the redirect URI, and these filters will always conflict with browser intent filters if the redirect URI starts with 'http'. This would cause Android to ask the user if they want my app or a browser to handle the result, which could be confusing to the user. If I could set a custom scheme there would be no conflict and it would always redirect right back to my app. So it can be done without resorting to custom schemes, and I have done it before. But the best solution would involve a custom scheme so it can redirect from a browser window without intent filter conflicts.
  5. wile_e8

    Oauth Errors - HTTP 400 Bad Request

    One more OAuth problem: I'm trying to update my app to use the external browser for the Oauth login, but for that I can't use localhost for the redirect URI and need to set up a custom URI to filter the redirect back to my app. But whenever I try to set something like these suggested custom URIs (aka "my.special.scheme://other/parameters/here") in the app settings in the Inoreader preferences, I get an error saying "Please enter a valid redirect URI!". So what counts as a valid URI for Inoreader?
  6. wile_e8

    Oauth Errors - HTTP 400 Bad Request

    As far as I can tell the object containing the actual error is a message saying "Bad Request" in an HTTP response packet with 400. I couldn't find any other data attached, at least not through Retrofit. But I did try submitting a request through curl to see if I could get a better look at the response. When trying it at first with the format curl -H "Content-type: application/x-www-form-urlencoded" <entire URL above with new authorization code> I got a response {"error":"invalid_request","error_description":"The request method must be POST when requesting an access token","error_uri":"http:\/\/tools.ietf.org\/html\/rfc6749#section-3.2"} So I reformatted curl to explicitly use post curl -H "Content-type: application/x-www-form-urlencoded" --data <parameters from above URL with new authorization code> https://www.inoreader.com/oauth2/token And I got a valid response. So I think the problem is how I'm formatting the POST request. Although I am telling Retrofit to use POST in the interface, so I'm going to have to do some digging on what is wrong there. Unless there is an issue with how Inoreader is accepting POST responses here - every other POST request I've done with the Inoreader API is working fine. EDIT: It was me - Retrofit has to be set up differently for URL encoded forms with POST. In case anyone else ever stumbles onto this post, here is the correct format: @FormUrlEncoded @POST("oauth2/token") Observable<ResponseBody> oauth2GetToken(@FieldMap Map<String, String> options);
  7. wile_e8

    Get Starred via API

    The feed ID for starred articles is user/<user_id>/state/com.google/starred, where <user_id> is replaced with the ID of the user. Use that feed ID the same way you would get the contents of any feed.
  8. I'm trying to implement Oauth login with Inoreader for my Android app, but every time I try to obtain the access and refresh tokens I get the HTTP error response "HTTP 400 Bad Request". I'm assuming this means something is wrong with the HTTP request I'm sending in. I'm guessing it's something subtle or stupid that is wrong with my code, because as far as I can tell the URL I'm submitting seems to match what's in the documentation. But after many various attempts to change the submission to something that won't give a 400 error, I'm giving up and asking is anyone here can see what I'm doing wrong. So here's a bit of a code dump about how I'm making the request. First of all, here is the URL I'm submitting: And in case that's not enough, here is the code that sets up the request. I'm using Retrofit on Android - here is the interface: @POST("oauth2/token") Observable<ResponseBody> oauth2GetToken(@QueryMap Map<String, String> options); And here is how I set up the Retrofit service: OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(new AuthHeaderInterceptor()) .build(); Retrofit restAdapter = new Retrofit.Builder() .baseUrl("https://www.inoreader.com") .client(client) .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) .build(); mService = restAdapter.create(InoreaderRxService.class); And then the request parameters. "code" is retrieving the code from the redirect parameters, REDIRECT_URI is "http://localhost", and the app_id and app_key are the values from my Inoreader app registration: Map<String, String> queryMap = new HashMap<>(); queryMap.put("code", params.get("code")); queryMap.put("redirect_uri", URLEncoder.encode(REDIRECT_URI, "utf-8")); queryMap.put("client_id", BuildConfig.INOREADER_APP_ID); queryMap.put("client_secret", BuildConfig.INOREADER_APP_KEY); queryMap.put("scope", ""); queryMap.put("grant_type", "authorization_code"); And here is where I set the header in the interceptor: public Response intercept(Chain chain) throws IOException { Request request = chain.request(); Request.Builder builder = request.newBuilder() .addHeader("Content-type", "application/x-www-form-urlencoded"); Request newRequest = builder.build(); return chain.proceed(newRequest); Normally I just return builder.build(), but I added the extra line so I could set a debugger breakpoint after builder.build(). That breakpoint is where I got the request URL at the top of this post. I had also tried adding "Content-length" and "user-agent" headers, but that didn't help. Anyway, after the interceptor submits the new request, it eventually returns with the 400 Bad Request error. I'm assuming I just have one or two things I did incorrectly or forgot to do, but in all of that I can't pick out what it is. Sorry for the code dump, but I'm hoping someone can find the problem somewhere in there. Thanks for the help.
  9. wile_e8

    Multiple Copies Of Feed For Filters

    I've never used tags or rules before, so I'm not for sure exactly how to handle that. But adding parameters to the end of the URL allowed me to create multiple instances of the same feed like I originally wanted, so that's the solution I'm going with for now. Thanks for the help.
  10. Is it possible to somehow add a feed multiple times? I'd like to apply different filters to a feed and then have the different filters show up as separate items in the subscription list. I've tried multiple ways to add the feed again, but every time it says I've already subscribed to that feed. I'd really like it if there was a way to add a feed multiple times, especially if the existing subscriptions are filtered in some way. Why I'd like to do this: My local newspaper used to have different RSS feeds for different sections of the paper, but for some reason they deleted all of the RSS feeds except for one main feed with all of the articles in the newspaper. I'd like to try to recreate all of the different section feeds with filters, but since I can only add a feed one time all of the different articles that get by the filters would all get dumped into one subscription. So articles by writer A, whose articles I always read, would be easy to miss if they are in the same subscription list as articles from sections X, Y, and Z, whose articles I occasionally read if the headline is interesting. It would be nice if I could somehow put articles from writer A in a completely separate list under the subscription list. Sorry if this is a duplicate, but I tried a few different searches and couldn't find anything like this.