github-login | A React Component for GitHub Login | OAuth library
kandi X-RAY | github-login Summary
kandi X-RAY | github-login Summary
React component for GitHub login. This project originally created and maintained by Checkr. However, after over a year of inactivity it appears this repository is abandoned. With many issues open, I decided to clone and maintain this repo myself. Credit goes to Kurt Ruppel from Checkr for being the original developer on the project. This project is now being updated and maintained by donmorton.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Convert query parameters to query string
- Parse a query string
- validate props
- Call a function
- lit helper function
- Creates a new Object
- Creates an instance of another
- call a function
github-login Key Features
github-login Examples and Code Snippets
Community Discussions
Trending Discussions on github-login
QUESTION
I have implemented passport
with GitHub-Strategy
. Here's the Glith.
It works wonderfully and I'm receiving the user-profile on redirect from GitHub.
Now, I'm only trying to understand how this actually works 'under the hood'. I did not find any similar question here on stackoverflow, neither on Passport.
So if I open Chrome Developer Tools during the Auth-Flow, the following seems to be going on when I click on Login with GitHub:
- the node route
/auth/github
is called - node redirects to
https://github.com/login/oauth/authorize?response_type=code&redirect_uri=https%3A%2F%2Frightful-exclusive-carriage.glitch.me%2Fauth%2Fgithub%2Fcallback&client_id=ccfcc73fac8223317176
- the user is presented with GitHub-Login-Page
- User types in GitHub-credentials and clicks 'Login'
- GitHub checks the credentials
- If valid credentials are provided, user is authenticated and GitHub redirects to the registered callback-endpoint, which is in my case:
https://rightful-exclusive-carriage.glitch.me/auth/github/callback
- The callback-url has a url-parameter, e.g.
?code=02337a951c242b9202fd
. It's interesting to note, that it's a GET-method and nothing else is provided. - On the server, the
passport.authenticate('github', ...)
method is called inside of the/auth/github/callback
-route. - When the GithubStrategy is instanciated, a callback-function is passed with the signature
function(accessToken, refreshToken, profile, cb)
. Somehow magically, theaccessToken
andprofile
are fully available here. And I don't understand how this happens.
How is passport receiving the profile?
Is node.js
making a server-side call to GitHub? Maybe with the ?code=
?
ANSWER
Answered 2020-May-10 at 13:53Yeah that is exactly what NodeJS is doing. This doesn't have anything to do with Passport.JS or Node.JS. It is the OAuth mechanism of how authorizations work.
Whenever a the Identity provider like twitter/facebook calls your /callback
with a ?code=
query param It then hits another url and gets the AccessToken, RefreshToken and Idtoken(which is basically the user profile).
You can check out in the source code as well:
In this strategy.js#L157 and strategy.js#L173 of passports oauth strategy:
QUESTION
I am running an app in a kubernetes service on Azure and have had it set up with an NGINX ingress controller and a public IP address with a FQDN. This was all working fine.
I then wanted to add security through using the oauth2-proxy for third party sign-in. I would like to keep my setup to one ingress-controller and one oauth2_proxy per namespace, with multiple apps running together. As Azure does not support the use of sub-domains for this I have been using paths to route to the correct app. I've seen examples, like this, on how to use one oauth2_proxy for multiple sub-domains but is it possible to get it working with multiple paths instead?
Setup
This is the current working setup with only one app, located on root /
. I would like to switch to an app specific path and the ability to run multiple apps on different paths. eg. /my-app
, /another-app
etc.
oauth2-proxy-config.yaml
...ANSWER
Answered 2020-Apr-05 at 21:44Sure, it's doable with multiple ingress paths inside single Ingress resource definition, please check this working example:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install github-login
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page