Ticket #2278 (closed enhancement: duplicate)

Opened 5 years ago

Last modified 5 months ago

Add basic authentication support

Reported by: anonymous Assigned to: rjollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords: remote authentication
Cc: Trac Release: 0.10

Description

Is there any way we could add basic authentication support into this include macro?

Would it involve adding code like this to it?

# create a password manager
password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()

# Add the username and password.
# If we knew the realm, we could use it instead of ``None``.
top_level_url = "http://example.com/foo/"
password_mgr.add_password(None, top_level_url, username, password)

handler = urllib2.HTTPBasicAuthHandler(password_mgr)

# create "opener" (OpenerDirector instance)
opener = urllib2.build_opener(handler)

# use the opener to fetch a URL
opener.open(a_url)

# Install the opener.
# Now all calls to urllib2.urlopen use our opener.
urllib2.install_opener(opener)

Attachments

Change History

08/05/09 01:13:01 changed by rjollos

  • summary changed from Basic authentication support to Add basic authentication support.

12/13/12 21:10:12 changed by hasienda

  • keywords set to remote authentication.
  • owner changed from coderanger to rjollos.

12/13/12 21:30:27 changed by hasienda

  • status changed from new to closed.
  • resolution set to duplicate.

#6879 has been transformed into a duplicate of this ticket.

It's pointing to #4743, that holds some promising code for implementing the requested feature as well.


Add/Change #2278 (Add basic authentication support)




Change Properties
Action