Coder Social home page Coder Social logo

finish_authenticate_v2 error about box.py HOT 4 CLOSED

nlrosidi avatar nlrosidi commented on August 16, 2024
finish_authenticate_v2 error

from box.py.

Comments (4)

tals avatar tals commented on August 16, 2024

request.REQUEST['code'] is provided as an example, and would only work if you're in a Django request handler.

essentially, once you click 'approve' on Box's dialog, they will redirect you to a URL of your choosing (see their docs to see how to change that).
They supply a HTTP GET parameter named 'code' to that url, which is what you use to call finish_authenticate_v2.

So for example, if you configured Box to hit http://www.myapp.com/finish_box, when you click on "approve", Box will issue a request that looks something like 'http://www.myapp.com/finish_box?code=code_goes_here&.....'

from box.py.

tals avatar tals commented on August 16, 2024

See documentation here: http://developers.box.com/oauth/

from box.py.

nlrosidi avatar nlrosidi commented on August 16, 2024

Thanks for the clarification. This may or may not be the appropriate forum
to ask this question but I have a Django app already made and want to
incorporate this API into my app. Is there anything I need to do to set up
a Django request handler so that your code works out of the box?

Also, I see that Box issues a request that can look like ''
http://www.myapp.com/finish_box?code=code_goes_here&.....', how would i
grab the code and put it into the finish_authenticate_v2?

Thanks
Nate

Nate

On Mon, Dec 2, 2013 at 3:34 PM, tals [email protected] wrote:

request.REQUEST['code'] is provided as an example, and would only work if
you're in a Django request handler.

essentially, once you click 'approve' on Box's dialog, they will redirect
you to a URL of your choosing (see their docs to see how to change that).
They supply a HTTP GET parameter named 'code' to that url, which is what
you use to call finish_authenticate_v2.

So for example, if you configured Box to hit
http://www.myapp.com/finish_box, when you click on "approve", Box will
issue a request that looks something like '
http://www.myapp.com/finish_box?code=code_goes_here&.....'


Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-29669707
.

from box.py.

tals avatar tals commented on August 16, 2024

It's not the right forum, but for django, you need to do the following (more or less):

in urls.py, add a pattern routing. Say something like:

urlpatterns = patterns(
     ....
     (r'^finish_box', box_authentication_done),
     ...
)

and then in your views.py, have something like:

def box_authentication_done(request):
    code = request.REQUEST.get('code')
    ....

so if you hit /finish_box?code=1234
code will be '1234'

For anything more, please check django tutorials and forums. That library has no relation to Django :)

from box.py.

Related Issues (12)

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.