How do I pass in password to Pyramid and Cornice?

1.1k Views Asked by At

I have a url like this:

http://site/account/login/

I want to do this through command-line, without form.

import requests
requests.get(url, auth=('username-goes-here', 'password-goes-here'))

But how do I design my views function in Pyrmaid using Cornice?

@user.get()
def login(request):

I don't see the auth tuple appears in requests.GET at all. I need to be able to get those parameters out...

Any idea?

1

There are 1 best solutions below

0
On

You can use HTTP headers to pass authentication token. See http://cornice.readthedocs.org/en/latest/tutorial.html