diff --git a/example/socketsio-auth0-sample/README.md b/example/socketsio-auth0-sample/README.md new file mode 100644 index 0000000..a8467fc --- /dev/null +++ b/example/socketsio-auth0-sample/README.md @@ -0,0 +1,21 @@ +# Auth0 + Socket.io + +This is the seed project you need to use if you're going to create a Socket.io single page app that will use Auth0. + +### Configure your Auth0 credentials + +First, you need to put your `AUTH0_DOMAIN` (example.auth0.com), your `AUTH0_CLIENT_ID` and your `AUTH0_CLIENT_SECRET` on the `auth0-variables.js` file . You can find this information in the Application Settings on your Auth0.com dashboard. + +### Set up the Allowed Origin (CORS) in Auth0 + +Then, you need to put `http://localhost:3001` as an Allowed Origin (CORS) in the Application Settings on your Auth0.com dashboard. + +### Running the example + +In order to run the example, you need to have `node` installed. + +1. run `npm install` +1. run `node index.js` in the directory of this project. + + +Go to [http://localhost:3001](http://localhost:3001) and you'll see the app running :). diff --git a/example/socketsio-auth0-sample/auth0-variables.js b/example/socketsio-auth0-sample/auth0-variables.js new file mode 100644 index 0000000..b55e87d --- /dev/null +++ b/example/socketsio-auth0-sample/auth0-variables.js @@ -0,0 +1,5 @@ +(function (exports){ + exports.AUTH0_DOMAIN = 'Your_Auth0_Domain'; + exports.AUTH0_CLIENT_ID = 'Your_Auth0_Client_Id'; + exports.AUTH0_CLIENT_SECRET = 'Your_Auth0_Client_Secret'; +})(typeof exports === 'undefined' ? this['auth0Variables']={}: exports); diff --git a/example/index.html b/example/socketsio-auth0-sample/index.html similarity index 90% rename from example/index.html rename to example/socketsio-auth0-sample/index.html index 4a7ac34..8d61c02 100644 --- a/example/index.html +++ b/example/socketsio-auth0-sample/index.html @@ -15,10 +15,11 @@ #login button { width: 10%; padding: 8px; border: none; background: rgb(130, 255, 130);} - + +