Git Product home page Git Product logo

login-with's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

login-with's Issues

Issue with multi dot subdomains

Hi there,

thanks for this awesome project!

I just noticed that if you use multiple subdomains (multi dot subdomains) like this one:

dev.login.mydomain.com

You will get a cookie for .login.mydomain.com. I don't think this is intentional, since a cookie for .login.mydomain.com is not really useful ;)

Extracting a multidot subdomain from a domain is not trivial, since there are TLDs (or second level domains) like co.uk, that also contain a dot.

I googled around and found out that there is a public maintained list with all TLDs:

https://publicsuffix.org/

There are also tools that use the list to parse domain names, e.g.:

https://github.com/wrangr/psl

It looks like wrangr/psl does not have any dependencies and might be save for use. It uses MIT license as well.

_src disabled?

It's open-source and deployed on now.sh, so why is the _src URL disabled?

Reddit strategy doesn't redirect to failure URL on declined auth request

To reproduce:

  1. Go to https://login-with.com/login
  2. Login with Reddit
  3. Hit the "decline" button on the reddit auth request page

You'll get redirected to https://auth.login-with.com/reddit/callback with {"error":null,"user":false}

This is happening because in routes.js here, both error and user are falsy and so it falls through to the res.json at the end.

A solution here would probably be to change line 34 to if (error || !user) - would you accept a PR for that? I'm not sure if this is happening for other providers, I've only tested with reddit.

Scopes

Given a login-with instance how could an application request additional scopes for the authorisation request?

Should we allow this?

I work for a streaming site that has a lot of varied scopes, sometimes just having the user's record isn't enough.

I've taken a stab at this here: ProbablePrime@a6e0d30 but wanted to open an issue before the PR to see if this was something that would be welcome.

What is it exactly?

I wrote this on a Show HN about this, but was (correctly) called out for not opening an issue about that:

The information on /login should probably be on / so I can read somewhere what "Stateless authentication microservice" actually means.
Also maybe a sentence why this is neat and should be used...

Someone else wrote:

"Stateless authentication microservice" has only one possible meaning to me. Did you want to ask something more specific, or do you just not know what those (common) words mean?
reply

to which I then replied

The me it means... nothing specific.
It tells me that is has something to do with login, "without state" (whatever this means in this context) and that it is somehow not a "big service" but very "micro", so probably independent. Stateless and microservice can mean so many things.

So please take this as a bit of feedback: Not everyone really and fully understand the current description.

No love for Microsoft?

Microsoft login support would be awesome. A lot of people have Office365, and other MS services just like Google...

initial values on mandatory env variables

Hello!,

I want to test your oauth authentication using docker the thing is that i'm new into docker, i have red several docs but in the end i have no clue about which initial values do mandatory environment variables need in order to compile in terminal?

I need some guidance.

Here is my screen with my setup.

mmm

And here is the other screen with the terminal error.

docker error

it says cant find env variable, but i put it in my set up, please, help.

Make cookie content customizable

Let the user configure, which meta data per strategy is included in jwt and/or profile cookie.

Maybe by using env variables LW_GOOGLE_JWT_META=email,hobby,animal.

See also #36

Email authentication

This looks super great, thanks ๐Ÿ‘

I want to migrate my app which has Facebook and email + password auth. Do you plan to add auth using email link and/or login/password?

Discuss: Security concerns

I think it's unsafe to leave sensitive data such as access tokens (in the case of Oauth2 like Google).

If an attacker is able to retrieve a cookie he can easily decode the JWT token and use the access token to issue arbitrary requests to the authentication provider APIs and retrieve any information that might have been originally granted to it by the user (e.g. read my Gmail emails...).

I think the point of this lib is to make this kind of authentication processes stateless (or backendless) and storing the access tokens directly in the cookie is an easy win. Anyway I would at least try to protect this sensitive data by applying some level of encryption, maybe a simple symmetric encryption, using the same secret used to generate the JWT token signature as key would enough...

I look forward to knowing the community thoughts on this matter

session-memory-store

I saw you using a no more mantained in-memory store module for the express-session.

I recommend switching to a fully-tested one, check it out: memorystore

README typo

The README says "Your Google Client ID" and "Your Google Client Secret" in the LinkedIn section.

Not seeing cookies

Great work!

I tried this out on my local, and I don't see any cookies saved. I just see "{}" when I visit the "auth" endpoint. Everything seems to work, as I get redirected to Github's oauth page, and then back. Then, I tried it on your site, https://login-with.now.sh/login , and I see the same thing. Everything appears to work, and your app is my Github authorized Apps ( https://github.com/settings/applications ), along with my app. I did a console.log(user) under

onAuthenticationCallback: (req, res, next) => { const type = req.path.split('/')[1] passport.authenticate(type, (error, user) => {

and the user is there, in the format that is set up in github.js.

I tried a try/catch around the res.cookie section, and there were no exceptions.

Any ideas?

How to identify a returning user? Should provider-id not be added in token?

Hello,

I have a simple question. Say I've logged in once and got a JWT, and then log in on another machine using the same social account. Maybe I'm mistaken, but I can't find any way to (easily) tell that both tokens belong to the same person since the provider ID doesn't seem to be stored in the token. So is there a way to identify a user without having to make a request to the provider API with the given access token?

Error! No secret found by uid or name XXX

I ran now lipp/login-with -e LW_SESSION_SECRET=... -e LW_JWT_SECRET=... -e LW_SUBDOMAIN=... -e LW_FACEBOOK_APPID=... -e FACEBOOK_APPSECRET=..., but still got the error Error! No secret found by uid or name "lw-reddit-clientsecret" (and the error changes every time). It looks like all env vars are required, even the optional ones?

The demo github login fails

When I try to log into github on the demo application (https://login-with.now.sh/login) the server responds with:-

{"error":{"name":"AuthorizationError","message":"The redirect_uri MUST match the registered callback URL for this application.","code":"redirect_uri_mismatch","uri":"https://developer.github.com/v3/oauth/#redirect-uri-mismatch","status":500}}

Different Scopes

If I wanted to request different scopes is it just better to fork and modify the strategies or is there another way that scope can be configured? I didn't seem to see anything in the code that suggested it would be configured by an environment variable, but that might make for a good feature?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.