Authentication in Ionic/Cordova App

前端 未结 2 814
北荒
北荒 2021-01-29 18:09

First off, I\'m no pro.

In my quest to become a better developer I am trying to understand what is needed and how to accomplish creating a sign-up/login for an Ionic-Fra

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-29 18:55

    I actually needed something like that for a few apps I'm working on. I spent quite some time investigating this and was able to achieve that.

    I'm pretty happy with the result, in addition to email/password authentication I've added some social authentication which works in the same way.

    1. open url on client side with the provider's (facebook/twitter/instagram) url for login
    2. the user logs in and is redirected to the server's callback url (my server is written in nodejs)
    3. once I've got the access token from the provider. I save this token and then create a token for the client to reuse every time the user wants to access a protected ressource.

    Download the apk and test it.

    If this is what you're looking for you can checkout both the client side code at : https://github.com/malikov/Authenticate.me-client-cordova-ionic

    And the server side code at : https://github.com/malikov/Authenticate.me-Node-Server

提交回复
热议问题