Giter Site home page Giter Site logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
To support http authentication we need to implement 
CefRequestHandler::GetAuthCredentials():

http://code.google.com/p/cefpython/source/browse/include/cef_request_handler.h#1
50

virtual bool GetAuthCredentials(CefRefPtr<CefBrowser> browser,
                                  bool isProxy,
                                  const CefString& host,
                                  int port,
                                  const CefString& realm,
                                  const CefString& scheme,
                                  CefString& username,
                                  CefString& password) { return false; }

Original comment by [email protected] on 23 Aug 2012 at 7:59

  • Changed state: Accepted

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I've implemented CefRequestHandler but came into issues. Some of the functions 
of that handler run on IO thread and you cannot execute Python on that thread 
and this means trouble, we can bypass it but the solution will make more time. 
Need to figure out how to do asynchronous callbacks for the getauthcredentials.

Original comment by [email protected] on 24 Aug 2012 at 6:07

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
I've had some discussion with Cython users and we have a simple solution for 
all thread problems, there won't be needed any modifications, python code can 
run on any of the threads.

Discussion here:
https://groups.google.com/forum/?fromgroups=#!topic/cython-users/jcvjpSOZPp0

Original comment by [email protected] on 27 Aug 2012 at 6:03

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
[deleted comment]

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
Http Authentication is now supported, version 0.36 released, go to Downloads.

Let know if everything works fine.

Original comment by [email protected] on 29 Aug 2012 at 5:57

  • Changed state: Fixed

from cefpython.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 20, 2024
If you would like to provide your own custom implementation of http 
authentication, you are somewhat limited when you do that from pure python.

To provide a custom implementation you need to overwrite  GetAuthCredentials() 
in RequestHandler.

This function is called on IO thread and from what I've tested a GIL lock needs 
to be released for it to work if you want to display a modal dialog window. 
Currently this authentication is implemented by calling DialogBoxIndirect(), 
the source is here:

http://code.google.com/p/cefpython/source/browse/httpauth/AuthDialog.cpp

The only way to implement custom http authentication, as of now, is to display 
a dialog inside the browser by using html/css/javascript, you can do this by 
calling [Browser].GetMainFrame().ExecuteJavascript(). You would need to use 
some kind of "while True" loop with a call to time.sleep() and periodic checks 
to the html/js whether clicked OK/Cancel in your html-based dialog.

Original comment by [email protected] on 29 Aug 2012 at 6:32

from cefpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.