Python Forum
Passing basic auth data between views
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing basic auth data between views
#1
I am trying to give files only to authenticated users. In one viewpoint i have this code:

	auth = request.authorization
	if not auth or not counters.check_auth( auth.username, auth.password ):
		return counters.authenticate()
The current viewpoint then hands the flow to another view point like this:

% ( url_for( 'download' ), filename, hits, lastvisit )
My question is how to read auth.username from the /download view point?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Basic SQL query using Py: Inserting or querying sqlite3 database not returning data marlonbown 3 1,303 Nov-08-2022, 07:16 PM
Last Post: marlonbown
  auth - URL SUN 2 1,478 May-20-2022, 07:50 AM
Last Post: SUN
  IBM Watson: Handshake status 403 Forbidden or No section: 'auth' groschat 1 2,756 May-07-2021, 03:44 PM
Last Post: jefsummers
  ImportError: No module named pydrive.auth lknights1987 5 5,841 Jun-23-2020, 06:40 PM
Last Post: snippsat
  Passing data to Labview gives NoneType amasta 0 1,901 Mar-18-2019, 04:13 PM
Last Post: amasta
  PUT with Basic Auth and urllib2 rootVIII 0 2,915 Feb-22-2019, 11:25 PM
Last Post: rootVIII
  google-auth requirements.txt strange behavior randalpinto 3 3,669 Dec-21-2018, 02:03 AM
Last Post: Larz60+
  "Raise SMTPException("SMTP AUTH extension not supported by server.") NajeebUllah 3 7,919 Mar-16-2018, 09:45 PM
Last Post: nilamo
  social-auth-app-django wheel and dependables "six" metalray 2 2,886 Nov-27-2017, 08:16 AM
Last Post: metalray

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020