Giter VIP home page Giter VIP logo

auth0-nodejs-webapp-sample's Introduction

Auth0 Node Web App Samples

CircleCI

These samples demonstrate how to add authentication to a Node.js application with Auth0. Each folder contains a distinct application so that various Auth0 features can be viewed in isolation.

Embedded Integration Samples

These samples use Auth0's hosted login page which offers the fastest, most secure, and most feature-rich way to add authentication to your app.

For samples which demonstrate how to embed the Lock widget or a custom login form directly into your application, see the embedded-login branch.

What is Auth0?

Auth0 helps you to:

  • Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.
  • Add authentication through more traditional username/password databases.
  • Add support for linking different user accounts with the same user.
  • Support for generating signed Json Web Tokens to call your APIs and flow the user identity securely.
  • Analytics of how, when and where users are logging in.
  • Pull data from other sources and add it to the user profile, through JavaScript rules.

Create a free Auth0 account

  1. Go to Auth0 and click Sign Up.
  2. Use Google, GitHub or Microsoft Account to login.

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The Responsible Disclosure Program details the procedure for disclosing security issues.

Author

Auth0

License

This project is licensed under the MIT license. See the LICENSE file for more info.

auth0-nodejs-webapp-sample's People

Contributors

aaguiarz avatar adamjmcgrath avatar albertoperdomo avatar alexisluque avatar aron123 avatar benlizar avatar chenkie avatar cocojoe avatar damieng avatar davidpatrick avatar dependabot-preview[bot] avatar dependabot[bot] avatar dmtomczyk avatar evansims avatar ewanharris avatar frederikprijck avatar healeycodes avatar jfromaniello avatar jimmyjames avatar jjcp avatar joshcanhelp avatar karlhorky avatar lbalmaceda avatar mathrobin avatar mikearias3 avatar ntotten avatar paulioceano avatar snyk-bot avatar vmartynets avatar widcket avatar

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

auth0-nodejs-webapp-sample's Issues

Login sub does not work.

I've opened the project in webstorm, and it fails to start.

I'm on windows 10x
using the latest of node, 7.10.x.

I've simply done the following:

npm i
npm start

Audience

Hi,

We we're integrating a NodeJS app and we got stuck for a while because the token being returned by Auth0 wasn't a JWT (and we needed it to be one to call other APIs) and instead an opaque token.

This was only solved when we included in the login passport call (https://github.com/auth0-samples/auth0-nodejs-webapp-sample/blob/master/01-Login/routes/auth.js#L13) the audience of our API.

I believe this should be included in the documentation, but I'm not entirely sure where so I'm opening this ticket to bring this to attention.

ERR_CONNECTION_REFUSED

Hi there. I change the .env file to reflect my client data and when I try to login I get ERR_CONNECTION_REFUSED in my browser console.

What could be going wrong?

invalid_request (parameter organization is required for this client)

Using Nodejs.

On login I get the error described in the the header ( invalid_request (parameter organization is required for this client)).

Here is the stdout:
BadRequestError: invalid_request (parameter organization is required for this client)
at C:\Users\AliceBroadhurst\source\repos\Auth0 test app\node_modules\express-openid-connect\middleware\auth.js:120:31
at processTicksAndRejections (internal/process/task_queues.js:95:5)

I am using an OIDC connection on an organization. The app setting allow only for the organisation (via the connection) to log in. My app works fine when it allows for normal users and org users but fails when it requires the organisation details.

README links not working

Simply as the title says, non of the links in the readme seem to work.

Could anyone update those? Thank You

TokenError: Unauthorized when login in

Hi!

I would like to ask your help solving the "Token Error" I get when running the app. I have installed everything according to the README. But the moment I click "Login", I get Unauthorized 500 TokenError: Unauthorized. The configuration
setup is also correct. I am googling this issue, but without luck.

Thank you in advance!

Screenshot 2020-12-02 at 17 03 36

spelling error in README.md

Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.

You might want to write above line like below.

Add authentication with multiple authentication sources, either social like Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, among others, or enterprise identity systems like Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider.

Screen Shot 2021-05-21 at 3 05 52 PM

Lock version is outdated

Lock version is outdated on the following sections:

01-login
02-custom-login
04-user-profile
05-linking-accounts
06-rules
07-authorization
09-mfa
10-customizing-lock

In the layout.pug file, as shown on the following image:
image

Latest version is V10.14

Ticket: AUTH-3368

Stateless Example

Hello,

It would be great to see a stateless example in which we use passport-auth0 just to authenticate the user and we then create our own JWT to authenticate towards our own API. I'm using the { state: false } configuration when creating a new strategy but facing the error:

TypeError: Cannot set property 'authParams' of undefined

When removing express-session.

Thank you

user_metadata example?

I'm using the hosted login page variant and I want to verify I can get the user_metadata. I added user_metadata to the scope in routes/auth.js but they're not showing on the user object. How can I get the user_metadata?

Login page wont load

Hi there i am running the sample i have correctly installed node modules and also i have inserted the values in the env file now when ever i open localhost:3000/login then a progress ring is shown and the app does not go forward can anybody tell me that what i am missing?

Missing parameter on callback url

The state parameter is missing on the callback url. To reproduce:
-Select the login option or go to "/login" route.
-Type the credentials of the account(in case you've logged in before, select "not your account")
-Click login.

image

If on the seccond step you select the account used to log in before, the state parameter is correctly returned.

Callback URL mismatch.

I have a fresh installation of the repo. Copied the client ID, domain and client secret from Auth0 application settings. Run using npm start. On clicking login get the following:

Callback URL mismatch.
The provided redirect_uri is not in the list of allowed callback URLs.

I tried changing the allowed callback URL in auth0 settings to http://localhost:3000 same error.

Failure to obtain access token using Vivaldi

When I configure this app against my local vivaldi instance, both sign-up and login flows are interrupted with the following error on callback:

Failed to obtain access token

InternalOAuthError: Failed to obtain access token
    at Strategy.OAuth2Strategy._createOAuthError (/Users/ktraff/workspace/auth0-nodejs-webapp-sample/01-Login/node_modules/passport-oauth2/lib/strategy.js:408:17)
    at /Users/ktraff/workspace/auth0-nodejs-webapp-sample/01-Login/node_modules/passport-oauth2/lib/strategy.js:175:45
    at /Users/ktraff/workspace/auth0-nodejs-webapp-sample/01-Login/node_modules/oauth/lib/oauth2.js:191:18
    at ClientRequest.<anonymous> (/Users/ktraff/workspace/auth0-nodejs-webapp-sample/01-Login/node_modules/oauth/lib/oauth2.js:162:5)
    at ClientRequest.emit (events.js:314:20)
    at TLSSocket.socketErrorListener (_http_client.js:469:9)
    at TLSSocket.emit (events.js:314:20)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

Using the python quickstart app allows me to login and sign-up successfully.

After logout, browser back brings back to authenticated state

How to reproduce

  • Run 01-Login app
  • Click on 'Log In' for login to the app.
  • Auth0 login page appears, login as you want.
  • The app is redirected to /user, where I can see my avatar.
  • Click on the Logout tab
  • Unauthenticated page appears with Login tab and button
  • Hit browsers back button

Actual

  • Authenticated page appears with my avatar!

Expected

  • I should login to my avatar (authenticated page)

outdated dependencies

Sample using outdated version of packages body-parser, cookie-parser, debug, dotenv, express, morgan, passport-auth0 and auth0-lock. (AUTH-3731)

The sample is not working

Hi

The example provided doesn't work out of the box. I get the following errors on any browser I try to authenticate from :

On the server :

GET /callback?error=unauthorized&error_description=Access%20denied.&state=STATE

From the auth0 application logs :

{
  "date": "2018-10-22T08:39:18.294Z",
  "type": "f",
  "description": "Access denied.",
  "connection_id": "",
  "client_id": "CLIENT_ID",
  "client_name": "CLIENT_NAME",
  "ip": "217.128.79.75",
  "user_agent": "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko",
  "details": {
    "body": {},
    "qs": {
      "response_type": "code",
      "redirect_uri": "http://localhost:3000/callback",
      "scope": "openid email profile",
      "state": "STATE",
      "client_id": "CLIENT_ID"
    },
    "error": {
      "message": "Access denied.",
      "oauthError": "unauthorized",
      "type": "oauth-authorization"
    }
  },
  "hostname": "HOST_NAME",
  "user_id": "auth0|USER_ID",
  "user_name": "USER_NAME",
  "log_id": "LOG_ID"
}

Can you give me a hint ?

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.