Utopian Registration: Backend - Social Login with Github, Facebook & LinkedIn

in #utopian-io8 years ago (edited)

Utopian_wolf.png

Hello everybody,

this Contribution Post is part of the Utopian Registration-Project.

The goal for the Utopian Registration is, to allow People who are new to STEEM to create an Utopian ( STEEM ) - Account through Utopian itself (and not how it is currently handled, through STEEMIT).

And one of the most important groundworks for this, is the actual login with a Github, Facebook or LinkedIn account.

In this Contribution-Post I'll take you through the changes I've made to the utopian-api-backend and what is working right now.

You can check out the changes I made to the frontend in this post.

The Pull-Request

image.png

You can find the pull-request here: Pull Request

The Logic

While the frontend was pretty much straight forward - the backend needed a bit of creativity.

The reason for this is, because there are happening several things when a user logs in via social login.

1.) Get User

After some internal logic with access_tokens and oAuth2 where the user is getting logged in - we receive a code which can be used to retrive the data from the social provider - Github, Facebook and linkedin. (However, LinkedIn gave some problems so it isn't used right now).

2.) Analyse and create User in DB

This data was then used to rate the user and to see if he was already verified by the social provider - for example through 2FA or something similar and then a temporary user is created - which is for keeping track of the current status of the user.

For example: if the user has already created a STEEM account or if he still needs to verify SMS / Email. And some data about the user.

3.) Redirect User

After this, the user will be redirected on the frontend to the right site.

Which means - if he has verified Email & SMS OR Email & Social-Account (2FA in Github e.g.) then he gets redirected to the Steem-Account Name-Selection.

If he hasn't verified anything - then he gets redirected to email verification.

What's next?

Next up for me is the email verification and SMS verification. While those are both things that I also haven't done before - I'm happy for the challenge.

So - until then,

-Wolf



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

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

Achievements

  • 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

Thank you for the contribution. It has been approved.

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

What was the core reason behind this change? Outreach?

Hello therealwolf!

We have found your post and the @SteemEngineTeam wants you aboard!

We are the fastest growing content, vote and follower sharing community on Steem. Please see our introduction post for details on how to join and start earning more votes!