Giter Site home page Giter Site logo

auth0-samples / auth0-jquery-samples Goto Github PK

View Code? Open in Web Editor NEW
14.0 26.0 48.0 194 KB

Auth0 Integration Samples for jQuery

Home Page: https://auth0.com/docs/quickstart/spa/jquery

License: MIT License

HTML 26.33% JavaScript 64.77% CSS 4.26% PowerShell 1.23% Shell 1.46% Dockerfile 1.97%
auth0 authentication quickstart jquery spa dx-sdk

auth0-jquery-samples's Introduction

Auth0 jQuery Samples [DEPRECATED]

Deprecation notice

This repository has been deprecated and is no longer maintained.

auth0-jquery-samples's People

Contributors

aaguiarz avatar albertoperdomo avatar alexisluque avatar annyv2 avatar chenkie avatar harenson avatar heikeraraujo avatar iannyanes avatar jimmyjames avatar jmangelo avatar joshcanhelp avatar luisrudge avatar mehreencs87 avatar mostekcm avatar rafanog avatar twistedstream avatar vmartynets avatar

Stargazers

 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

auth0-jquery-samples's Issues

Required increase of leeway parameter value

Required increase of leeway parameter value in all seeds projects.
Current value leeway: 30
Value with which it works leeway: 60

This causes the following error when trying to log in:
image

Update link on README.md

Please update README.md for Seed Starter

You can read a quickstart guide for this sample here.

No link exist. Thanks.

Missing leeway parameter in the app.js

The projects 01-Login, 02-User-Profile, 03-Calling-an-API, 04-Authorization has not the parameter leeway in the webAuth instantiation.
File app.js

image

This causes the following error when trying to log in:

image

Information displayed in the browser console:

image

Outdated dependencies (express & express-jwt)

04-Authorization and 03-Calling-an-API sample projects are using outdated dependencies of the libraries:
"express": "^4.14.0" -> latest version: 4.15.3
"express-jwt": "^5.1.0" -> latest version: 5.3.0

image

Is the callbackURL the same with the AUTH0_CALLBACK_URL on 02-Custom-Login?

I noticed that in the app.js, the custom-login requires a callbackURL: 'http://YOUR_APP/callback'.
Is this the same with the AUTH0_CALLBACK_URL found in the auth0-variable.js?

  • If yes, why not use the callbackURL in the auth0-variable.js?
  • If not, please include in the README file that they have to include a callbackURL in the app.js - callbackURL: 'http://YOUR_APP/callback'. Then maybe give a note or purpose for adding the callbackURL.

Also, the link in the "You can read a quickstart guide for this sample here" is also broken. Please update.

I have created an issue the other day which can be added in this README.md too. You can include "adding the callbackURL in the app.js" in the important setup section, too.

Thanks :)

Why is the access_token stored in local storage?

Why is the access_token stored in local storage?

Thought this is not secure?

function setSession(authResult) {
// Set the time that the access token will expire at
var expiresAt = JSON.stringify(
authResult.expiresIn * 1000 + new Date().getTime()
);
localStorage.setItem('access_token', authResult.accessToken);
localStorage.setItem('id_token', authResult.idToken);
localStorage.setItem('expires_at', expiresAt);
}

Update README.md on 01-Login

Before Running the Example Section.

Important Setup:

  1. Include your AUTH0_CLIENT_ID and AUTH0_DOMAIN in your auth0-variables.js. These can be found in the Application Setting of your dashboard.
  2. Go to the Application Setting and include http://localhost:3000 in the following fields:
  • Allowed Callback URLs
  • Allowed Origins (CORS)

This will prevent the following errors:

  1. Callback URLS - Callback URL mismatch.
    The url "http://localhost:3000/" is not in the list of allowed callback URLs: .
  2. CORS - [Error] XMLHttpRequest cannot load https://yourappname.auth0.com/user/ssodata. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin.

Where to find the Application setting:

  1. Go to: Client
  2. Choose the App that you are using and click the Settings Icon in line with it. You will find all the details about your app.

Adding this info in the README.md will prevents potential errors or questions from future Auth0 clients.

Thanks. :)

Required increase of leeway parameter value

Required increase of leeway parameter value in all seeds projects.
Current value leeway: 30
Value with which it works leeway: 60

This causes the following error when trying to log in:
image

SPA JQuery wrong validation of credentials

In the JQuery quickstart, the validation of credentials to show some options and the message indicating that you're already logged in only considerates the "expires_at" field.

I was able to manually generate and set this time on the browser's local storage, then I was able to access the options for a logged in user:

capture

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.