{"id":19871551,"url":"https://github.com/druxt/druxt-auth","last_synced_at":"2026-01-26T19:39:52.824Z","repository":{"id":39972589,"uuid":"465125252","full_name":"druxt/druxt-auth","owner":"druxt","description":"Authentication module for DruxtJS","archived":false,"fork":false,"pushed_at":"2025-04-24T06:38:20.000Z","size":449,"stargazers_count":3,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-04-24T07:43:05.719Z","etag":null,"topics":["druxt","module","nuxt-auth","oauth2"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/druxt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-02T02:13:11.000Z","updated_at":"2023-03-02T10:40:57.000Z","dependencies_parsed_at":"2023-10-12T03:42:40.668Z","dependency_job_id":"2fd75996-c0a6-4fe9-8d89-badd848c8176","html_url":"https://github.com/druxt/druxt-auth","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":"druxt/module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druxt%2Fdruxt-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druxt%2Fdruxt-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druxt%2Fdruxt-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/druxt%2Fdruxt-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/druxt","download_url":"https://codeload.github.com/druxt/druxt-auth/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252015717,"owners_count":21680815,"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":["druxt","module","nuxt-auth","oauth2"],"created_at":"2024-11-12T16:12:43.404Z","updated_at":"2026-01-26T19:39:47.791Z","avatar_url":"https://github.com/druxt.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DruxtAuth\n\n[![npm](https://badgen.net/npm/v/druxt-auth)](https://www.npmjs.com/package/druxt-auth)\n[![CI](https://github.com/druxt/druxt-auth/actions/workflows/ci.yml/badge.svg)](https://github.com/druxt/druxt-auth/actions/workflows/ci.yml)\n[![Known Vulnerabilities](https://snyk.io/test/github/druxt/druxt-auth/badge.svg?targetFile=package.json)](https://snyk.io/test/github/druxt/druxt-auth?targetFile=package.json)\n[![codecov](https://codecov.io/gh/druxt/druxt-auth/branch/develop/graph/badge.svg)](https://codecov.io/gh/druxt/druxt-auth)\n\n\u003e Druxt Authentication with Drupal Simple OAuth2 and nuxt/auth.\n\n## Links\n\n- DruxtJS: https://druxtjs.org\n- Community Discord server: https://discord.druxtjs.org\n\n\n## Install\n\n`$ npm install druxt-auth`\n\n### Nuxt.js\n\nAdd module to `nuxt.config.js`\n\n```js\nmodule.exports = {\n  buildModules: [\n    'druxt',\n    ['druxt-auth', {\n      clientId: '[DRUPAL_CONSUMER_UUID]',\n      clientSecret: '[DRUPAL_CONSUMER_SECRET]',\n      scope: ['default'],\n    }]\n  ],\n  druxt: {\n    baseUrl: 'https://demo-api.druxtjs.org'\n  },\n}\n```\n\n_Note:_ Replace `[DRUPAL_CONSUMER_UUID]` and `[DRUPAL_CONSUMER_SECRET]` with the details from the consumer created in the following step.\n\n### Drupal\n\n1. Download, install and setup the [Simple OAuth module](https://www.drupal.org/project/simple_oauth).\n2. Create a Consumer depending on your desired authorization strategy:\n\n    - **Authorization Code** grant:\n        - New Secret: _leave this empty_\n        - Is Confidential: _unchecked_\n        - Use PKCE?: _checked_\n        - Redirect URI: `[FRONTEND_URL]/callback` (e.g., `http://localhost:3000/callback`)\n\n    - **Password** grant:\n        - New Secret: _provide a secure secret_\n        - Is Confidential: _checked_\n        - Redirect URI: `[FRONTEND_URL]/callback` (e.g., `http://localhost:3000/callback`)\n\n## Usage\n\nThe DruxtAuth module installs and configures the **nuxt/auth** module for your Druxt site.\n\nIt adds two auth strategies  that can be used via the `$auth` plugin:\n- `drupal-authorization_code`  \n  ```js\n  this.$nuxt.$auth.loginWith('drupal-authorization_code')\n  ```\n\n- `drupal-password`\n  ```js\n  this.$nuxt.$auth.loginWith('drupal-password', {\n    data: {\n      username: '',\n      password: ''\n    }\n  })\n  ```\n\n  _Note:_ Nuxt must be running in SSR mode for password grant, and client secret must be set.\n\n\n- See the **nuxt/auth** documentation form more details: https://auth.nuxtjs.org/api/auth\n\n\n## Options\n\n| Option | Type | Required | Default | Description |\n| --- | --- | --- | --- | --- |\n| `clientId` | `string` | Yes | `undefined` | The Drupal Consumer UUID |\n| `clientSecret` | `string` | No | `undefined` | The Drupal Consumer API secret. Required for Password grant. |\n| `scope` | `array` | No | `undefined` | The OAuth Scopes to be used for the Drupal Consumer. |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruxt%2Fdruxt-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdruxt%2Fdruxt-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdruxt%2Fdruxt-auth/lists"}