Skip to content

darkyen/auth0-chrome-extension-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/#.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:"

About

Chrome Extension POC for Auth0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published