mercredi 2 octobre 2019

Get/Set cookie and use on another website (Flask, BoxBilling)

So essentially i want to archive a "SSO" feel.

I have created a website, where i call data from the BoxBilling API. I also use the API to authenticate the user on my website, and see which data the user can access from BoxBilling, and which the user cannot. I keep the session token in a Cookie, and essentially i want that cookie to be usable for the BoxBilling system, so you don't have to login again, if you are referred to the "real" BoxBilling site. As of now, i have manually edited my cookie on the BoxBilling website, and it authenticates great (logs me in and what not).

However, i want BoxBilling to recognise my cookie from the other site, and use that automatically and not ask for "Input username and password"

Does that makes sense? - I'm fairly new to web development, so this i quite a hassle for me. And i cant seem to figure it out.

I tried the following: 1. Set the cookie to be domain wide, and not only domain specific (eg. cookie exists on .mydomain.com) 2. Set the cookie manually on the BoxBilling login page (Actually worked)

I have also speculated in, if it was possible to create a hyperlink, that was able to log the user in, using the cookie details.

Any ideas?

I use Flask as an engine.




Aucun commentaire:

Enregistrer un commentaire