-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to parse response from OAuth URL #52
Comments
Yeah, lol definitely not a good idea! Thank you for bringing this up. I have seen this before when working with some custom geocoding services. This error message tells me that the body is sent as plain text instead of the json that it was expecting. Since this is an issue with Do you know what version of ArcGIS Enterprise you're running on? That might help me. |
This comes from
What this is telling me is that the response from your Enterprise is not returning |
One thing to also ask your admin is if there is a reverse proxy or something which is modifying the headers. Edit: in the mean-time, could you explore using an API key and using that with |
Yeah, that would make sense to me. Wonder if maybe there's a way to check for plain text responses and coerce them to JSON, if possible, from the package side? Or if there's a way to verbose-ly get whatever that plain text response is, that might be helpful to look at too, for debugging purposes. Our admin says we're on Enterprise 10.8 here! I can ask about the reverse proxy and see if he knows anything on that front. Not sure about the API key— the documentation here talks about them vis-a-vis the ArcGIS Platform or Places Service; do you know if there's a way to set up an API key in an enterprise portal? We'd probably need to stick with the geocoder we have in there, for our purposes— but I'm on the data science side, not the IT admin side, so maybe there's a different way of setting this up that I just don't know about :) |
There isn't any way for us to change the oauth client flow to accept plain text input. That would have to be reported in {httr2} or we would have to write the OAuth flow from scatch which feels a bit out of scope. Above all, I believe that accepting I'm not sure what the best way to address this is because the Enterprise server should be returning |
Oh!— you're so right, of course {httr2} is handling all that, not sure why that didn't click for me earlier. Yup, totally out of scope for this, then. And the security concern is also valid, I hadn't thought of that either. FWIW, just heard back from our GIS admin— he attests that the enterprise is returning JSON, and that we have no reverse proxies going on. |
Sure, I'll pass that info along— thanks, Josiah! |
@aaronkrusniak wonderful! Let me know what you find. If it is |
Hey again! Up until now, I've just been authenticating through
arc.check_portal()
/auth_binding()
— worked great for testing, but trying to move toauth_client()
using OAuth so we can use this new package in our automated scripts and stuff. (Sometimes Arc Pro automatically logs you out of your portal after a period of inactivity, so unfortunately I don't thinkauth_binding()
would work non-interactively in the long term for us.)Unfortunately, running into a problem with
auth_client()
where I'm getting the following error:I thought it was probably something to do with the way our internal enterprise is set up, but I double checked with our administrator and we think we have the OAuth client ID all set up properly. (And I have the ID set to my environment variables correctly, and have restarted R, etc.)
What stumped me is when I tried
auth_code()
— I'm able to log into our enterprise portal and receive an OAuth code just fine. However, when I copy that code into R, I get the exact same error as above. The code looks to be a 216-character long token that always ends in..
; I tried putting it in raw as well as in quotes and got the same result either way.Not sure how exactly to give you a reprex for this one, given we're on an enterprise portal and it's probably not a good idea to paste the raw tokens here. But let me know if there's anything I can give you that would make this any easier to look into; I'm happy to help any way I can!
The text was updated successfully, but these errors were encountered: