{"id":28957199,"url":"https://github.com/developmentseed/bones-auth","last_synced_at":"2025-06-23T21:41:45.995Z","repository":{"id":66924779,"uuid":"1429199","full_name":"developmentseed/bones-auth","owner":"developmentseed","description":"Base authentication model, view and middleware","archived":false,"fork":false,"pushed_at":"2012-07-20T19:47:05.000Z","size":317,"stargazers_count":18,"open_issues_count":7,"forks_count":4,"subscribers_count":43,"default_branch":"master","last_synced_at":"2024-04-10T03:11:32.184Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developmentseed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-02T03:58:04.000Z","updated_at":"2021-05-07T15:56:00.000Z","dependencies_parsed_at":"2023-02-20T14:25:29.448Z","dependency_job_id":null,"html_url":"https://github.com/developmentseed/bones-auth","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/bones-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fbones-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fbones-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fbones-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fbones-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/bones-auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fbones-auth/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561484,"owners_count":23177616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-23T21:41:45.627Z","updated_at":"2025-06-23T21:41:45.986Z","avatar_url":"https://github.com/developmentseed.png","language":"JavaScript","readme":"Bones Auth\n----------\nProvides base `Auth` and `AuthList` (model, collection) base\nclasses and `authenticate` Connect middleware for implementing basic\nsession-based user login with Backbone.js, Bones and Express.\n\nA basic `User` model that extends `Auth` is provided as an example and\nstarting point. Integration with `bones-admin` through administrative views\nis also available.\n\n### Tested with\n\n- developmentseed bones 0.0.2\n- documentcloud backbone 0.3.3\n- visionmedia express 1.0.7\n\n### Running tests\n\n- Use [kkaefer's expresso branch](https://github.com/kkaefer/expresso/tree/stop_listening_servers)\n- Run `npm test`\n\n### Components\n\n- `bones-auth.js`: client side javascript. Contains the mvc classes for any\n  client-side `backbone.js` code to reference.\n- `bones-auth`: common js module for use with node.js. Includes server-side\n  specific overrides to mvc classes as well as other server-side code.\n\n### Usage\n\n#### `Auth`\n\nAbstract model class. Extend it with your own model to create a model which can\nbe \"authenticated\". See the `User` model for an example.\n\n#### `AuthList`\n\nAbstract collection class. Extend it for use with collections that contain\nmodel classes inheriting from `Auth`.\n\n#### `authenticate` middleware\n\nRequire `authenticate` connect middleware and add it as a middleware for\nauthenticating models. Automatically adds and manages the Connect session\nmiddleware -- session cookies will only be sent and active when authenticating\nand/or an authenticated session already exists. Allows for sane proxy caching.\n\n    var express = require('express'),\n        server = express.createServer(),\n        secret = 'MySecretKey';\n\n    // Express middleware.\n    server.use(express.bodyDecoder());\n    server.use(express.cookieDecoder());\n\n    // Pass secret key to Bones for CSRF protection.\n    require('bones').Bones(server, { secret: secret });\n\n    // Require bones-auth to use authenticate middleware.\n    // Handles authentication requests to `/api/Authenticate`.\n    var authenticate = require('bones-auth').authenticate;\n    server.use(authenticate({ secret: secret });\n\n#### Authors\n\n- [Will White](http://github.com/willwhite)\n- [Young Hahn](http://github.com/yhahn)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fbones-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fbones-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fbones-auth/lists"}