Social Meal - social application - Add login by Facebook

in #utopian-io3 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:



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
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.


Posted on - Rewarding Open Source Contributors


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.

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!


  • 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!


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

Coin Marketplace

STEEM 0.16
TRX 0.03
JST 0.026
BTC 13683.84
ETH 408.51
USDT 1.00
SBD 1.00