Giter Club home page Giter Club logo

auth0-chrome-extension-poc's Introduction

auth0-chrome-extension-poc

This repository contains code that can be used as a base to initialize Auth0 in context of a Chrome Extension. The process looks like the following.

screen shot 2016-10-05 at 1 48 19 am

---

screen shot 2016-10-05 at 1 55 44 am

---

screen shot 2016-10-05 at 1 56 19 am

What is happening here

From browser_action/browser_action.html we open a new popup that contains Lock in redirect mode at login/login.html, the login.html code will intialize a new Lock based on parameters passed by browser_action allowing the same page to be used with multiple locks. The redirect_uri is set to callback/callback.html where we set the idToken if you have background events or background pages in your application you can optionally send a message to your extension with the callback and initiate a visual feedback, here we simply send a notification.

Required Permissions

  • In chrome manifest you need to allow access to src/callback/callback.html

      "web_accessible_resources": [
        "src/callback/*"
      ]
  • You will need to allow access to your Auth0 domain and Auth0 CDN

      "permissions": [
        "https://chrome-extension-sample.auth0.com/*",
      ]
  • In content security policy, you'll need to allow, this is because Lock loads the client file from the CDN

      "content_security_policy": "script-src 'self' https://cdn.auth0.com blob: filesystem: chrome-extension-resource:"

auth0-chrome-extension-poc's People

Contributors

darkyen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

auth0-chrome-extension-poc's Issues

invalid origin error

Hi, thanks for this great example.

One thing that happened to me is when i tried to login from chrome extension, i got 'invalid origin' with chrome-extension:// as the origin. i also tried to add 'chrome-extension://*' in the auth0 client setting, but it's still not working.

any suggestion to fix this?

Chrome Extension ID

Hey there, thanks for posting your repos. You posted 2 repos, one poc and one that isn't. The one that isn't says you need to white list the chrome extension id, however, each installation of the chrome extension generates a new id for my users doesn't it? So doesn't that mean if I whitelist MY id, my users ID won't be whitelisted for the callback url?

Also additionally , does the POC version of your repo, solve the issue I spoke about earlier, not sure if I'm being clear, I'm a newbie with AUTH0 so forgive me if it's dumb question.

Security Concerns

branch: chrome_identity

I got this working (great work BTW), but obviously can't decode the resulting token with my global secret. Which brings up the security issue.

If my server were to ignore decoding with a secret, anyone - that was willing - could create a valid token and impersonate someone (if they actually knew, for example, their google id). That's no good.

Now I'm trying to get around that issue by using a custom Authorization header scheme and hashing the generated secret. But then here we are again. An attacker could easily reverse engineer this and gain access.

Am I missing something here?

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.