{"id":21198609,"url":"https://github.com/natlibfi/passport-atlassian-crowd-js","last_synced_at":"2025-07-10T06:30:41.869Z","repository":{"id":34448452,"uuid":"177731743","full_name":"NatLibFi/passport-atlassian-crowd-js","owner":"NatLibFi","description":"Passport strategy for Atlassian Crowd","archived":false,"fork":false,"pushed_at":"2024-08-14T15:11:25.000Z","size":505,"stargazers_count":4,"open_issues_count":2,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-07-02T11:57:07.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NatLibFi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-26T06:56:31.000Z","updated_at":"2024-08-14T15:11:01.000Z","dependencies_parsed_at":"2024-08-14T16:19:31.608Z","dependency_job_id":null,"html_url":"https://github.com/NatLibFi/passport-atlassian-crowd-js","commit_stats":{"total_commits":12,"total_committers":3,"mean_commits":4.0,"dds":"0.41666666666666663","last_synced_commit":"b8a0c1a473fa141823c8dba872054679bd5edd26"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/NatLibFi/passport-atlassian-crowd-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Fpassport-atlassian-crowd-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Fpassport-atlassian-crowd-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Fpassport-atlassian-crowd-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Fpassport-atlassian-crowd-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NatLibFi","download_url":"https://codeload.github.com/NatLibFi/passport-atlassian-crowd-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NatLibFi%2Fpassport-atlassian-crowd-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264538580,"owners_count":23624436,"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":"2024-11-20T19:52:40.069Z","updated_at":"2025-07-10T06:30:41.563Z","avatar_url":"https://github.com/NatLibFi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Passport strategies for Atlassian Crowd  [![NPM Version](https://img.shields.io/npm/v/@natlibfi/passport-atlassian-crowd.svg)](https://npmjs.org/package/@natlibfi/passport-atlassian-crowd) [![Build Status](https://travis-ci.org/NatLibFi/passport-atlassian-crowd-js.svg)](https://travis-ci.org/NatLibFi/passport-atlassian-crowd-js)\n\nPassport strategies for Atlassian Crowd. There have been many but this module has the following features\n- Written in modern day Javascript/ECMAscript\n- Supports HTTP Basic authentication using username and password OR SSO token transparently\n- Supports HTTP Bearer authentication using Crowd session tokens as bearer tokens\n- Returns user data formatted as [common format and protocol for accessing contacts](https://tools.ietf.org/html/draft-smarr-vcarddav-portable-contacts-00)\n- Optional fetching of user group membership\n\n# Strategies\nThis module provides the following Passport strategies\n## Basic\nAuthenticates user based on Crowd credentials passed in as Basic HTTP authorization header or Crowd session cookie.\n## Bearer\nHTTP Bearer authentication works by first retrieving a token by using credentials and then using that token in further requests.\n### Credentials\nUsed to authenticate using credentials and creating bearer token.\n### Token\nUsed to authenticate using bearer token.\n\n# Usage\n## Importing modules\n### ES modules\n```js\nimport {BasicStrategy} from '@natlibfi/passport-atlassian-crowd';\n```\n### Node.js require\n```\nconst {BasicStrategy} = require('@natlibfi/passport-atlassian-crowd');\n```\n## Basic strategy\n### Example\n```\nimport express from 'express';\nimport passport from 'passport';\nimport {BasicStrategy} from '@natlibfi/passport-atlassian-crowd';\n\nconst app = express();\n\napp.use(passport.initialize());\n\npassport.use(new BasicStrategy({\n    url: CROWD_URL, appName: CROWD_APP_NAME, appPassword: CROWD_APP_PASSWORD\n}));\n\napp.get('/foo', passport.authenticate('atlassian-crowd-basic', {session: false}));\n```\n### Configuration\nThe configuration is passed in to the class constructor in an object which supports the following properties:\n- **url**: Crowd service URL\n- **appName** Crowd application name\n- **appPassword**: Crowd application password\n- **ssoCookie** *(Optional)*: Name of the SSO cookie. Defaults to **crowd.token_key**.\n- **fetchGroupMembership** *(Optional)*: Boolean indicating whether to retrieve group membership or not. Defaults to **false**.\n## Bearer strategies\n### Example\n```\nimport express from 'express';\nimport passport from 'passport';\nimport {BearerCredentialsStrategy, BearerTokenStrategy} from '@natlibfi/passport-atlassian-crowd';\n\nconst app = express();\n\napp.use(passport.initialize());\n\npassport.use(new BearerCredentialsStrategy({\n    url: CROWD_URL, appName: CROWD_APP_NAME, appPassword: CROWD_APP_PASSWORD\n}));\n\npassport.use(new BearerTokenStrategy({\n    url: CROWD_URL, appPassword: CROWD_APP_NAME, appPassword: CROWD_APP_PASSWORD\n}));\n\napp.post('/auth', passport.authenticate('atlassian-crowd-bearer-credentials', {session: false}));\napp.get('/foo', passport.authenticate('atlassian-crowd-bearer-token', {session: false}));\n```\n### Configuration\nThe configuration is passed in to the class constructor in an object which supports the following properties:\n#### Credentials\n- **url**: Crowd service URL\n- **appName** Crowd application name\n- **appPassword**: Crowd application password\n\n#### Token\n- **url**: Crowd service URL\n- **appName** Crowd application name\n- **appPassword**: Crowd application password\n- **fetchGroupMembership** *(Optional)*: Boolean indicating whether to retrieve group membership or not. Defaults to **false**.\n- **useCache** (*Optional)*: Boolean indicating whether to cache tokens and user information. Cache entries will only be removed when token expires. Defaults to **false**.\n# User data format\n```js\n{\n  id: '\u003cname\u003e',\n  name: {\n    givenName: '\u003cfirst-name\u003e',\n\tfamilyName: '\u003clast-name\u003e'\n  },\n  displayName: '\u003cdisplay-name\u003e',\n  emails: [{value: '\u003cpayload.email\u003e', type: 'work'}],\n  organization: []\n}\n```\nAnd with `fetchGroupMembership` set to true:\n```js\n{\n  id: '\u003cname\u003e',\n  name: {\n    givenName: '\u003cfirst-name\u003e',\n\tfamilyName: '\u003clast-name\u003e'\n  },\n  displayName: '\u003cdisplay-name\u003e',\n  emails: [{value: '\u003cpayload.email\u003e', type: 'work'}],\n  organization: [],\n  groups: [\n      'foo',\n      'bar'\n  ]\n}\n```\n\n## License and copyright\n\nCopyright (c) 2019 **University Of Helsinki (The National Library Of Finland)**\n\nThis project's source code is licensed under the terms of **MIT license**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlibfi%2Fpassport-atlassian-crowd-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatlibfi%2Fpassport-atlassian-crowd-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatlibfi%2Fpassport-atlassian-crowd-js/lists"}