Comments (13)
I have nothing against allowing this library to function over HTTP, but I'll defer to @ib-lundgren in this matter.
More generally, is it that much work? Generating a self-signed certificate and setting verify=False
on your Requests' calls doesn't seem that hard to me...
from requests-oauthlib.
There is already some support forthis and it is in place for OAuth 2 session if "DEBUG" is present in env. See if
$ export DEBUG=1
$ python ....
covers your needs. If not let me know or feel free to send a PR refactoring in is_secure_transport checks where needed.
from requests-oauthlib.
@Lukasa We are developing a Java app, and wrestling keystore files and Eclipse plugins is a hassle. :-/
@ib-lundgren The code in requests-oauthlib
does not refer to is_secure_transport
but checks the URL itself. I can update the code to use it.
from requests-oauthlib.
@jcassee I know, its on the TODO list :) Updates would be much appreciated, and feel free to update checks outside oauth 2 session as well.
from requests-oauthlib.
Ah, I see that the version on GitHub does check for DEBUG, but the version on pypi doesn't.
I'll try to refactor it using oauthlib
s is_secure_transport
from requests-oauthlib.
@Lukasa Hi, is verify=False
also available for OAuth1 ? I can't get it to work :(
from requests-oauthlib.
@Notmarrco How are you expecting it to work?
from requests-oauthlib.
@Lukasa to test access to a webapp, I did something like this : test = OAuth1Session (tokens, secrets ...)
and then after the first test.get(url, verify = False)
I get an error in core.py : AttributeError: 'Request' object has no attribute 'body'
from requests-oauthlib.
That's a bizarre error. The auth object should be called against a PreparedRequest
, not a Request
. Can you paste your full traceback please? =)
from requests-oauthlib.
Here it is : :)
Traceback (most recent call last):
File "./import.py", line 17, in <module>
r = test.get(url, verify=False)
File "/usr/local/lib/python2.6/dist-packages/requests/sessions.py", line 254, in get
return self.request('get', url, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/requests/sessions.py", line 241, in request
r.send(prefetch=prefetch)
File "/usr/local/lib/python2.6/dist-packages/requests/models.py", line 518, in send
r = self.auth(self)
File "/usr/local/lib/python2.6/dist-packages/requests_oauthlib/core.py", line 58, in __call__
if is_form_encoded or extract_params(r.body):
AttributeError: 'Request' object has no attribute 'body'
from requests-oauthlib.
Which version of requests are you using?
python -c "import requests; print requests.version"
I think in later versions this should be a "PreparedRequest", not "Request"
as @Lukasa mentions.
On Fri, Aug 9, 2013 at 4:27 PM, Notmarrco [email protected] wrote:
Here it is : :)
Traceback (most recent call last):
File "./import.py", line 17, in
r = test.get(url, verify=False)
File "/usr/local/lib/python2.6/dist-packages/requests/sessions.py", line 254, in get
return self.request('get', url, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/requests/sessions.py", line 241, in request
r.send(prefetch=prefetch)
File "/usr/local/lib/python2.6/dist-packages/requests/models.py", line 518, in send
r = self.auth(self)
File "/usr/local/lib/python2.6/dist-packages/requests_oauthlib/core.py", line 58, in call
if is_form_encoded or extract_params(r.body):
AttributeError: 'Request' object has no attribute 'body'—
Reply to this email directly or view it on GitHubhttps://github.com//issues/61#issuecomment-22401761
.
from requests-oauthlib.
ok thx to both of you !
upgrading did solve my problem 😄 ... I was still in 0.14.1 😦
from requests-oauthlib.
I don't see it stated in this thread -- the thread is probably older than the solution, but the fix seems to be to set the environment variable: OAUTHLIB_INSECURE_TRANSPORT=1
from requests-oauthlib.
Related Issues (20)
- Can't change method to 'client_secret_post" for authorization method.
- Fix documentation or fix the way client is handled in requests-oauthlib for refreshing tokens HOT 1
- 'requests' distribution not found when listed in install_requires together with requests_oauthlib
- why passing requests kwargs that may contain request params to refresh_token request ? HOT 1
- Optional
- Felse HOT 2
- (Optinal)
- Superseded by #2445.
- Thanks for stopping by to let us know something could be better! HOT 1
- `oauth2_session.OAuth2Session.refresh_token` creates infinite loop with Exchange Online when token expires
- Trying to use OAuth1Session with Flickr - requests_oauthlib.oauth1_session.VerifierMissing: No client verifier has been set. HOT 1
- ## Description HOT 1
- Add refresh token exception hook to list of compliance hooks?
- Requirements out of date HOT 2
- Hkş HOT 2
- Scope changes with Microsoft services & `offline_access`
- Question: Is this project maintained? HOT 1
- Compliance fix for tokens that never expire (e.g. Mailchimp)
- Redo request after token is updated
- Why is the backend client workflow asking for a code or a response url? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from requests-oauthlib.