05-29-2018, 08:08 PM
Hey there!
I recently discovered UserSpice, and I've been loving it as a user management framework for my latest project.
I've realized my project would benefit from a REST API, and I've given my partner the task to manage it. I prefer to use Python because it's something my partner is comfortable with, that way I can handle the PHP stuff and allow them to work on setting up endpoints for the API.
I now have a Python REST API demo working, however the last thing I have to work out before handing it over to my partner is authentication. Is there any way that I can check against the browsers session to see whether or not a user is logged in?
For example, I have the endpoint: api.mydomain.com/players
I will be using AJAX to call that endpoint from one of my pages, but I'd like to protect that endpoint from unauthorized requests outside of my page. This also allows me to log anybody who attempts to abuse the API outside of normal usage.
How can I utilize UserSpice alongside cookies/sessions/hashes in a way that will allow me to accomplish that?
I recently discovered UserSpice, and I've been loving it as a user management framework for my latest project.
I've realized my project would benefit from a REST API, and I've given my partner the task to manage it. I prefer to use Python because it's something my partner is comfortable with, that way I can handle the PHP stuff and allow them to work on setting up endpoints for the API.
I now have a Python REST API demo working, however the last thing I have to work out before handing it over to my partner is authentication. Is there any way that I can check against the browsers session to see whether or not a user is logged in?
For example, I have the endpoint: api.mydomain.com/players
I will be using AJAX to call that endpoint from one of my pages, but I'd like to protect that endpoint from unauthorized requests outside of my page. This also allows me to log anybody who attempts to abuse the API outside of normal usage.
How can I utilize UserSpice alongside cookies/sessions/hashes in a way that will allow me to accomplish that?