Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Eventbrite Authentication #38

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

indcoder
Copy link

No description provided.

Upstream Upate with LinkedIn
In production its best to go with a docker image that is nailed down to
its patch number , very useful duing debugging
Added Eventrbite OAuth 2.0 to the list of authentication mechanism
The merge conflict resolution added an extra space before the square
bracket which tripped standard js
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 99.27% when pulling ad82fc5 on MumbaiHackerspace:master into f75f2d8 on lipp:master.

username,
name: displayName,
provider: 'eventbrite',
email: emails[0].value
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to now, email is not included in public profile, since it it considered private information. the profile is not http-only and thus is more likely to be subject to an evil script / "attack".

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right ...I just realized that we dont require the email per se but rather we can have the Eventbrite userId in the username.

index.js Outdated
@@ -4,6 +4,8 @@ const cookieParser = require('cookie-parser')
const expressSession = require('express-session')
const MemoryStore = require('session-memory-store')(expressSession)

require('dotenv').config()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if we really should use it... do you have some hoster/deployment scenario which honors this way to pass env?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use is mostly for local deployment or when not using Docker ....especially when we are deploying directly to cloud like EC2 instances, we can just deploy .env file along with the production bundle

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@lipp
Copy link
Owner

lipp commented Jul 23, 2017

besides comments 💯

Since the email stored is not secure and could be misused, we should not
use email but rather store Eventbrite user id

Closes lipp#39
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 99.27% when pulling a2e12f3 on MumbaiHackerspace:master into f75f2d8 on lipp:master.

package.json Outdated
@@ -35,6 +36,7 @@
"cookie-parser": "^1.4.3",
"express": "^4.14.0",
"express-session": "^1.14.2",
"dotenv-extended": "^2.0.1",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need extended?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need this? isn't dotenv enough?

@@ -39,7 +39,7 @@ const Index = ({profile, origin}) => (
<h2 className='subtitle is-4'>
Stateless authentication microservice for
<ul>
{['Twitter', 'Facebook', 'Google', 'GitHub', 'Reddit', 'LinkedIn', 'Instagram'].map(name => <Item name={name} key={name} />)}
{['Twitter', 'Facebook', 'Google', 'GitHub', 'Reddit', 'LinkedIn', 'Instagram', 'Eventbrite'].map(name => <Item name={name} key={name} />)}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will not feature every login strategy on the demo page. Could you remove this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am in two minds about this

  1. If there is a particular strategy thats implemented within the login-with mircoservice, it should follow that there should be a button that will enable that authentication.
  2. It is unreasonable to expect everyone to enable buttons for ALL auth strategies

=> The auth buttons that are needed to be enabled or disabled should be configurable.
Also the URL in the example is hardcoded for it to make a call to login.login-with.com for auth calls, this too should be configurable because it will help others to test their added strategy on their own domain before pushing it unto upstream repo

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The login-with.com page (and the related demo code) is not meant to be deployed by anyone else.

The respective user / developer can configure which strategies to use via environment variables.

To test a specific strategy, you can directly connect (from browser) to your auth endpoint (e.g. auth.login-with.com/twitter or auth.your-service.com/eventbrite)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. But on the login-with site, no one will know ALL the strategies that have been implemented. I thinks its in the best interest of this OSS project to advertise all the strategies it supports.
    PS: I do not have a skin in the game nor do i rep Eventbrite. Its just that we run a OSS meetup group and we use EB for our checkins and we are building an OSS app to do this automatically.

  2. Also test not just the API but test it as a consumable from an app[which is its actual purpose] which the nextjs is ideal...since we can compare the behaviour across strategies.

@@ -26,7 +26,7 @@ const Login = ({profile, origin}) => {
const redirect = encodeURIComponent(origin + '/')
return (
<div className='section'>
{ !profile && ['Twitter', 'Google', 'GitHub', 'Reddit', 'Facebook', 'LinkedIn', 'Instagram'].map(service => (
{ !profile && ['Twitter', 'Google', 'GitHub', 'Reddit', 'Facebook', 'LinkedIn', 'Instagram', 'Eventbrite'].map(service => (
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will not feature every login strategy on the demo page. Could you remove this?

@@ -87,8 +88,8 @@ must be: `https://login.yourdomain.com/facebook/callback`
You need to create your own LinkedIn OAuth2 application. If `LW_SUBDOMAIN=login.yourdomain.com` your Authorization callback URL
must be: `https://login.yourdomain.com/linkedin/callback`

- `LW_LINKEDIN_CLIENTID` - Your Google Client ID
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good watch! THX

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 99.27% when pulling 958c24d on MumbaiHackerspace:master into f75f2d8 on lipp:master.

@lipp
Copy link
Owner

lipp commented Jul 31, 2017

we can keep dotenv in... just wanted to know why dotenv-extended is required.

Maninderjit Bindra and others added 2 commits August 1, 2017 19:45
Modified environment variable names as per the eventbrite.js strategy…
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 99.27% when pulling 9313f6f on MumbaiHackerspace:master into f75f2d8 on lipp:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants