Skip to content

Commit

Permalink
Added Facebook authentication via passport, fixed the RegExp us…
Browse files Browse the repository at this point in the history
…ed to retrieve the rate limit id from the `authorization` header, moved authentication gateway middleware into `zuul()`

Updating README

Updating README

Updating README
  • Loading branch information
avoidwork committed Aug 8, 2014
1 parent 97f4ad5 commit 38a4162
Show file tree
Hide file tree
Showing 39 changed files with 78,222 additions and 83,044 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## 0.4.0
- Added `Facebook` authentication via `passport`
- Fixed the `RegExp` used to retrieve the rate limit id from the `authorization` header
- Moved authentication gateway middleware into `zuul()`

## 0.3.6
- Upgraded turtle.io to 2.3.0
- Refactored `Basic Auth` to use `passport`
Expand Down
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = function (grunt) {
"src/prepare.js",
"src/rate.js",
"src/response.js",
"src/zuul.js",
"src/outro.js"
],
dest : "lib/<%= pkg.name %>.js"
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ This is a sample configuration for Tensō, without authentication or SSL. This w
```

## Authentication
The `protect` Array is the endpoints that will require authentication. Planned authentication options include `OAuth2 (generic)`, `Twitter`, `Facebook`, & `LinkedIn`.
The `protect` Array is the endpoints that will require authentication. Planned authentication options are `Twitter`, & `LinkedIn`.

### Basic Auth
```javascript
Expand All @@ -110,6 +110,25 @@ The `protect` Array is the endpoints that will require authentication. Planned a
}
```

### Facebook
Facebook authentication will create `/auth`, & `/auth/facebook` routes. `auth(accessToken, refreshToken, profile, callback)` must execute `callback(err, user)`.

```javascript
{
"auth": {
"facebook": {
"enabled": true,
"auth": function ( ... ) { ... }, /* Authencation handler, to 'find' or 'create' a User */
"consumer_key": "", /* Get this from Facebook */
"consumer_secret": "", /* Get this from Facebook */
"callback_url": "" /* This must match your application in Facebook */
"login": "/login" /* Path to redirect to on failed authentication */
},
"protect": ["/private"]
}
}
```

### Oauth2 Bearer Token
```javascript
{
Expand Down
10 changes: 9 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,17 @@
"enabled": false,
"tokens": []
},
"facebook": {
"enabled": false,
"auth": null,
"consumer_key": "",
"consumer_secret": "",
"callback_url": "",
"login": "/login"
},
"local": {
"enabled": false,
"callback": null,
"auth": null,
"login": "/login"
},
"twitter": {
Expand Down
Loading

0 comments on commit 38a4162

Please sign in to comment.