Comments (2)
Trying to wrap my head around this, so making some notes. The approach would be similar as with Facebook.
My assumption is that we want the usual flow, where the user authorizes the app on github and then they get taken back to the register screen, where their info is is filled in and can be edited.
https://developer.github.com/v3/oauth/
Ember app
- User decided to register through github.
client_id
,redirect_uri
,scope
andstate
need to be provided. Scope should be set to "user", or "user:email" or something appropriate (see link above) - Once the GitHub side of things is done, we will get a code back
- We use the code, alongside other parameters, including
client_id
andclient_secret
to get back an access token. - We use the access token to get user information and fill in the form
- Once user agrees on the information and submits, we send the info, alongside the access token, to github. There is no equivalent of
facebook_id
, but I guess we could use the github username for that.
API
users#create
is called and the payload is very similar to regular user creation, which diverges from how facebook does it.- There's a
github_access_token
and agithub_username
parameter. - We store those in new db columns for later access
- If params contain an image, then that's it. We save and render the user
- If there is no image, then we call a worker to set the image from GitHub
- We can use the Octokit gem for this.
The problem here is that quite a lot needs to be done on the client side to pre-fill the information. Maybe a good alternative would be to
- I'm pretty sure we still need to get an access token on the client side
- We send the access_token to the API, there we use it and
Octokit
to fill out the user information GitHub has available and then, when the API finally responds, the client APP can redirect to the edit profile route.
from deprecated-code-corps-rails-api.
Closed in favor of #9.
from deprecated-code-corps-rails-api.
Related Issues (20)
- Document User Categories API HOT 1
- Document User Roles API
- Document User Skills API
- Document Users API HOT 1
- Clarify that bin/setup must be run in new terminal window
- Find a way to deploy branch commits HOT 2
- Add ability to assign tasks HOT 1
- Reference GitHub repositories in a project HOT 1
- Reference GitHub repositories in a post HOT 1
- Add project updates to projects HOT 1
- Add GitHub authentication HOT 1
- Connect GitHub repositories to projects HOT 1
- Add the ability to push to Apiary in Circle HOT 2
- Documentation - Issue with credential exchange
- RFC - API Documentation Guidelines HOT 9
- Change wording in role skills
- Make changes suggested by API Blueprint linter
- Find better way of documenting coalesced ids
- Rework User Skills and Role Skills to remove "join table" references
- Fix project#create to respond according to JSON API spec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deprecated-code-corps-rails-api.