Basic Authentication in the header - Authorization : Basic <key>

ElliotB <[email protected]> Wed, 4 Apr 2018 15:01:28 -0700 (PDT)
Newsgroups gmane.comp.python.cherrypy
Message-ID <[email protected]>

I've reviewed the documentation at 
http://cherrypy.readthedocs.io/en/latest/basics.html#authentication in 
order to understand how to send my API call to Cherrypy and validate an API 
key that I'll have in the header of the HTTP request that I'll send from my 
client side program. The header will follow Basic Authorization with the 
header having the following example key and value Example: Authorization: 
Basic YWxhZGRpbjpvcGVuc2VzYW1l

Then I want the Cherrypy function that I write to run only after some 
authorization has be completed. From the client, I'll call my function 
like: https:///myfunction?param1=value&param2=value&param3=value with the 
Basic Authorization header set up as seen above

and in Cherrypy I'll code the function like:

 @cherrypy.expose
    def myfunction(self, param1=1,param2=cat,param3=dog):
            # do my work in the function 
        return 

Note: the function will not have a user enter any credentials. The call 
will pre-populate the basic authorization header programmatically.

Can you set up the Cherrypy code example in such a way to explicitly show 
me how this can be achieved. Assume a beginner with Cherrypy (e.g. did the 
first 5 or so tutorials only ( 
http://docs.cherrypy.org/en/latest/tutorials.html#tutorials ). Thanks much.

-- 
You received this message because you are subscribed to the Google Groups "cherrypy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cherrypy-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
To post to this group, send email to cherrypy-users-/JYPxA39Uh5TLH3MbocFF+G/[email protected]
Visit this group at https://groups.google.com/group/cherrypy-users.
For more options, visit https://groups.google.com/d/optout.