I’ve done some work with Pyramid and JWT. I use pyramid_jwtauth on the backend and Angular (with Satellizer) on the frontend. Here is a demo:
https://github.com/pauleveritt/pyramid_satellizer <https://github.com/pauleveritt/pyramid_satellizer> Satellizer is an AngularJS plugin which automates a bunch of the work, ultimately storing the JWT token in localStorage. It includes an “interceptor” which puts the token into request headers. You might not be using Angular or Satellizer, but that pattern works on the frontend. pyramid_jwtauth makes it easy to let Pyramid’s authentication machinery do the work for your, instead of decoding JWT in your views. —Paul > On Mar 17, 2016, at 7:20 AM, Krishnakant <[email protected]> wrote: > > I am using Pyramid and there is a RESTful api I wish to access. > the RESTful server sends a jwt header. > I know that I can use a session object of requests and keep the header. > But will this approach work? > I will have the requests used in my views and browser keeps sending all the > request. > Then I would have the session forward the browser's request to my REST api. > Note that in requests library, requests.session persists the jwt object so I > don't have to take trouble manualy sending the headers. > the only doubt is that how will this work if at all. > Should I not do the jwt stuff in the browser itself? > I mean should I store the jwt object in the $window of browser? > instead of requests.session? > Happy hacking. > Krishnakant. > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/pylons-discuss. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/pylons-discuss. For more options, visit https://groups.google.com/d/optout.
