-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
828 additions
and
446 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,56 @@ | ||
# User Authentification and role management REST Webservice | ||
# Usr Authentification and role management REST OAuth Webservice | ||
|
||
Everytime you start a new project or create a new service. You need to code the user authentification and your group management in order to manage you users. With Usr you just have one service and easy rest methods to manage you users and their groups. | ||
|
||
## Description | ||
|
||
Usr provides you a webservice to authenticate and manage your users with a REST API : | ||
|
||
- EveryAuth enable your users to login with any credentials or service (Facebook,...) | ||
- Your users create a unique account for all your services. | ||
- All your futures application can use usr to authentificate your user and get their roles. | ||
- Use any storage (MongoDb, CouchDb, MySQL,..) | ||
|
||
## Authentification of a user : | ||
|
||
1/ You deploy your service to auth.yourdomain.com | ||
2/ You can use Oauth2 to authentificate your user. | ||
|
||
|
||
## Status | ||
|
||
Currently there is not much working on, but you can user | ||
`make test` to see the status | ||
|
||
|
||
The goal of this project : | ||
|
||
An easy to deploy on cloudfoundry webservice that you can use for any of your project to authenticate your user and manage their groups. I follow oAuth2 specs and maps the group user in the scope. | ||
|
||
# Features/Status : | ||
|
||
In this first dev release you can find : | ||
- the beginning of the local storage (usefull for testing) | ||
- a Makefile | ||
- Some event capabilities with socket io | ||
- a bad version of authentification with token (will be replace quickly with oauth2) | ||
- Basic and non crypted user authentification | ||
- a bit of group management | ||
- Some tests | ||
- first ideas on access management | ||
|
||
Next priorities : | ||
- OAuth2 | ||
- More test | ||
- Group and access management | ||
- Full restfull interface | ||
- logs | ||
- coffee lint | ||
|
||
Some futures priorities : | ||
|
||
- Events with socket.io | ||
- MongoDb/CouchDb/Redis stores | ||
- Admin interface | ||
|
||
More is coming.... |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
express = require 'express' | ||
$ = require 'jquery' | ||
|
||
app = express.createServer( | ||
express.bodyParser(), | ||
express.favicon(), | ||
express.cookieParser(), | ||
express.session({ secret: 'supersecret'}), | ||
) | ||
|
||
myAppUrl = 'http://127.0.0.1:3001' | ||
usrAppToken = 'lalalal' | ||
usrUrl = "http://local.host:3000" | ||
|
||
|
||
app.get('/', (req, res)-> | ||
if req.session.user | ||
user = req.session.user | ||
res.send("Welcome : #{user.id}, you are in the groups : #{user.groups.join(',')}<a href='/logout/'>logout</a>") | ||
else | ||
res.send("<a href='#{usrUrl}/login/#{myAppUrl}/logguedIn/'>login</a>") | ||
) | ||
|
||
app.get('/logout', (req, res)-> | ||
delete(req.session.user) | ||
res.redirect(usrUrl+"/logout/#{myAppUrl}") | ||
) | ||
|
||
app.get('/logguedIn/:token', (req, res)-> | ||
url = usrUrl+"/info/#{req.params.token}/#{usrAppToken}" | ||
$.getJSON(url,(datas)-> | ||
req.session.user = datas | ||
res.redirect('/') | ||
) | ||
) | ||
|
||
app.listen(3001) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require('coffee-script') | ||
module.exports = require('./lib/exec.coffee'); | ||
module.exports = require('./lib/app'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.