{"id":16039480,"url":"https://github.com/adamsilverstein/wp-api-js-oauth","last_synced_at":"2025-04-05T05:41:52.274Z","repository":{"id":71874329,"uuid":"85227960","full_name":"adamsilverstein/wp-api-js-oauth","owner":"adamsilverstein","description":null,"archived":false,"fork":false,"pushed_at":"2017-03-20T13:18:55.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T20:17:30.436Z","etag":null,"topics":["javascript","oauth-client","oauth1","rest-api","wordpress","wp-api"],"latest_commit_sha":null,"homepage":null,"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/adamsilverstein.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-16T18:14:48.000Z","updated_at":"2017-04-03T16:36:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"74a41f4e-f823-4f93-9c86-87c9d2606255","html_url":"https://github.com/adamsilverstein/wp-api-js-oauth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsilverstein%2Fwp-api-js-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsilverstein%2Fwp-api-js-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsilverstein%2Fwp-api-js-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adamsilverstein%2Fwp-api-js-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adamsilverstein","download_url":"https://codeload.github.com/adamsilverstein/wp-api-js-oauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247294463,"owners_count":20915338,"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":["javascript","oauth-client","oauth1","rest-api","wordpress","wp-api"],"created_at":"2024-10-08T23:04:53.023Z","updated_at":"2025-04-05T05:41:52.249Z","avatar_url":"https://github.com/adamsilverstein.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## WP-API JS OAuth\n\n## About\nOAuth1 support for the wp-api.js JavaScript client.\n\nRequires WordPress 4.7.x.\n\nInitial release. Development ongoing at https://github.com/adamsilverstein/wp-api-js-oauth.\n\n## Use\n*Install the [OAuth1 plugin](https://github.com/WP-API/OAuth1) on the site you want to access and generate an Application key.*\n\nConnect to the OAuth server:\n```js\nwp.oauth.connect(\n\tclientKey,          // The application client key.\n\tclientSecret,       // The application client secret.\n\t'oauth1/request',   // The site request endpoint.\n\t'oauth1/authorize', // The site authorize endpoint.\n\t'oauth1/access'     // The site access endpoint.\n);\n```\n\nThe client will redirect the user to the authorization page and return them to the current page with temporary authorization tokens.\n\nThe client will make a second request to retrieve the long term token and stores that token in the browsers localStorage.\n\nThe client will detect the presence of the authorization token and use it for all authenticated requests.\n\nCurrently there is no renewal mechanism for expired tokens.\n\n### Provides:\n```\nwp.oauth.setup\nwp.oauth.debug\nwp.oauth.extractTokens\nwp.oauth.connect\nwp.oauth.getLongTermToken\n\n```\n\n### Extends:\n```\nwp.api.WPApiBaseModel.prototype.sync\n```\n\n### Example:\n\nCheck out this [demonstration widget plugin](https://github.com/adamsilverstein/wp-api-js-oauth-widget) to see the OAuth feature in action.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsilverstein%2Fwp-api-js-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadamsilverstein%2Fwp-api-js-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadamsilverstein%2Fwp-api-js-oauth/lists"}