mozilla / django-browserid

Django application for adding BrowserID support.
Mozilla Public License 2.0
179 stars 80 forks source link

Documentation for using Django-BrowserId with AJAX. #191

Closed varikin closed 11 years ago

varikin commented 11 years ago

I recently had to piece together how to do this and this is how I did it. It may not be complete, but it is a good start. One thing I am uncertain of is what to do with next. I had to set it to something that resolves otherwise, the AJAX handler would attempt to redirect and on 404, fail which caused the login to fail. It would be better since this is done via AJAX, to not need next.

Osmose commented 11 years ago

Thanks for the PR!

This is a good start. RE: The next parameter, when I normally add AJAX Persona auth to a site I use a custom view that inherits from Verify so that I can replace the redirect to next and instead return a JSON object with the results of the verification.

We also are planning to switch (hopefully before the next release) to using AJAX by default to submit the assertion (see the draft roadmap), so I'm not sure if we should include these docs now or wait until that's in so we can update them to include how to customize that instead. Thoughts?

varikin commented 11 years ago

If you have plans to switch to AJAX based, might be worthwhile to just go that route instead of this, but I guess that depends on the timeline.

Osmose commented 11 years ago

Yeah, my hesitation on making the call is that the timeline is "when someone gets the time". And we still need to agree a bit on the design of the API for it.

I think we can close this for now, but it's good evidence that we need to get off our butts and finalize that roadmap and start getting things going. :D

Thanks again for the PR. :+1: