Social Meal - social application - Add login by Facebook

in #utopian-io6 years ago (edited)

New Features

Login by Facebook

In this contribution I focused about possibility to login to this application by facebook account.
To this moment my API part has only one possibility to authorization. User has to create new account in this application. I decided with my friend who is making a android application connected with my server part, that we have to implement a facebook login to our application, what is more in the future we want to more integrated our application with facebook, such like posting to own table, sharing etc. All information ofc will be stored in our database including login time, address ip and other information, which make our application more safety.

screenshot from swagger with this method:

image.png

Implementation

Implementation is divided into several parts. This feature required some changes in code and adding new services, resources and other method.

  • screen with commits and pull request from github
    image.png
As you can see in commits implementation contains:
  • add new resources like: resources for login and user data from facebook.
  • add facebook service
  • add necessary methods in accountControler and services
  • add unit test for account service
How it works?

When want to login by Facebook in mobile application, send login request to Facebook. Then he receive facebook access token, this token is sending to our application with login request. We are checking if this user exsist in Facebook data and we send request to get a basic data like email, firstname and surname which are required in our application. Next step is checking if this user exist in our database, if exsist the system will create JWT Tokens and return to user. If user not exist system will create account in our application and return tokens. In next request user have to use tokens from our application to get other resources.

Links:



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

When will the integration with the mobile app happen? I'd like to try the features of this app.

You can contact us on Discord.
[utopian-moderator]

Hey @eastmael, I just gave you a tip for your hard work on moderation. Upvote this comment to support the utopian moderators and increase your future rewards!

thanks, my friend who is responsible for mobile app is now very busy, but I started developing a web application witch will also use this API.

Hey @piach I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.30
TRX 0.11
JST 0.033
BTC 64243.42
ETH 3152.93
USDT 1.00
SBD 4.28