Jump to content
Vineet Sawant

ProcessWire + Ionic : Handling User Authentication & Sessions

Recommended Posts

Hi,

I'm working on a simple Ionic app which is going to use ProcessWire as the backend.

This app allows people to upload images and then like/comment on them. It's a lot like a stripped down imgur app.

I've set up some basic services such as register, login & reset password.

There are a couple of things I am doubtful about.

1. How do I get user's unique session Id once he's successfully authenticated through AngularJS's http post request?

I'm currently using following code:

$sessions = $session->getAll();
$session_id = $session->_user["fingerprint"];

But I'm not sure if that's the right way to do it. I'm not even sure if that's the session id. I know there's something called SessionCSRF["name"], I tried that.

I'm sending session_id as response to http post request. Then I'm using that session id to check if user is authenticated for his/her further actions such as commenting/liking/posting etc.

2. Now that I've got the session id, how do I identify the user based on the given session id? or should I send user ID back to PW everytime user is performing any action?

Is it possible to identify user just based on the session fingerprint that I'm giving back to the app?

Among other things I'm considering are keeping a device id on the server for each user, so as to gain better control over user's sessions.

I can log out all the devices linked at once etc. 

I'd really love to hear from you guys how you'd plan to do this app. I'm experienced with PW but not very much with AngularJS.

Thank you.

Share this post


Link to post
Share on other sites

Or there are just not many people into the topic. The only thing I can provide you with is that apps most often do not use session authentication, but rather oauth, which I suspect does have a reason. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By MacLeod
      [GERMAN]
      Hallo Community,
      ich hoffe Ihr könnte mir weiter helfen?
      Ich habe Processwire bei meinen Webhosting Anbieter installiert ohne Probleme.
      Nun wollte ich es bei meinen Local webserver (MAMP 4.1) installieren...
      Leider zeigt er mir einen Datenbank fehler, dass er bestimmte Tabelle nicht finden kann!!!
      (Siehe Bild)
      Kann mir einer sagen, wodurch der Fehler verursacht wirt?
      Habe es auch schon bei einen Kumpel und eine anderen Local Webserver Umgebung Installiert. Immer der Selbe Fehler.
      Gruß
      MacLeod
       
      [ENGLISH]
      Hello Community,
      I hope you could help me further?
      I have Processwire installed at my webhosting provider without any problems.
      Now I wanted to install it on my local webserver (MAMP 4.1) ...
      Unfortunately he shows me a database error that he can not find certain table !!!
      (See image)
      Can someone tell me what causes the error?
      Have it already installed with a buddy and another Local Web server environment. Always the same mistake.
      greeting
      MacLeod
       

    • By Marcel
      Hey,
      I am about to use the tool Create Users Batcher. We have 450 users. When I tryed it with like 20 test users it worked but it took a while. Now my concerns are that 450 might be to stressful? Does anyone have experience with several hundreds of users? My thoughts are to split it in smaller goups and upload them one group after another.
      best wishes
      marcel
    • By gnanasekar
      Hello All,
      Hope all doing good, I am a newbie to processwire. I have an issue please help me out!!!
      Here is my question:
      I have two usernames with one email apparently. when rebuilding my Jenkins server, I get a failed to authenticate and now I cannot reset the password of the other account. Any help would be appreciated.
      Thanks
    • By Jennifer Stock
      Greetings. I would like to restrict access to certain sections of my organization's ProcessWire site using pubcookie. We are rolling out Shibboleth authentication later this year but for now, it seems I can only make use of our institution's single sign-on routine by utilizing rules in an .htaccess file. 
      I am wondering if there is a way to ask PW to apply these rules to certain pages in the site, whether via template type or location in the page tree:
      AuthType UWNetID PubcookieAppID "MyApplication" require type staff faculty  
    • By louisstephens
      So, I really don't know where to begin with this. I have the thought in my head (the basics), but not really sure how to set it up.
      The desired effect:
      The homepage is set up with a foreach loop that outputs all the child pages (basically just a bunch of pages with pdfs, docs etc stored in a file field). When A user is actually logged in, they can "star" an item or drag and drop (using Dragula) the page to a sidebar. Also, they would be able to reorder the pages in the sidebar.
      The question(s):
      I guess I have multiple questions regarding how to achieve this.
      Would it be best to create a page field in the user template to save the page(s)? How would you actually save the page state (sidebar output, reordering, etc) once the drag and drop has been used? Thanks in advance for any help! A lot of this was just what was in my head, so it might not make full sense. However, I will update this if I can actually wrap my head around everything.
×
×
  • Create New...