{"id":21932361,"url":"https://github.com/reneweb/oauth2orize_client_credentials_example","last_synced_at":"2025-04-19T19:22:12.405Z","repository":{"id":17229238,"uuid":"19998213","full_name":"reneweb/oauth2orize_client_credentials_example","owner":"reneweb","description":"This is an example of the oAuth client credentials flow using oauth2orize, express 4 and mongoDB.","archived":false,"fork":false,"pushed_at":"2014-05-30T12:37:41.000Z","size":176,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T12:11:41.462Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reneweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-20T21:28:11.000Z","updated_at":"2023-10-16T10:21:50.000Z","dependencies_parsed_at":"2022-08-19T15:20:25.837Z","dependency_job_id":null,"html_url":"https://github.com/reneweb/oauth2orize_client_credentials_example","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/reneweb%2Foauth2orize_client_credentials_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneweb%2Foauth2orize_client_credentials_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneweb%2Foauth2orize_client_credentials_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reneweb%2Foauth2orize_client_credentials_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reneweb","download_url":"https://codeload.github.com/reneweb/oauth2orize_client_credentials_example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249778238,"owners_count":21324221,"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-28T23:18:24.314Z","updated_at":"2025-04-19T19:22:12.375Z","avatar_url":"https://github.com/reneweb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"oauth2orize_client_credentials_example\n======================================\n\nThis is an example of the oAuth client credentials flow using oauth2orize, express 4 and mongoDB.\n\n##### Installation\n\n```\ngit clone https://github.com/reneweb/oauth2orize_client_credentials_example.git\nnpm install\nnode app.js\n```\nNote: You may need to change the database configuration in the db.js file, if mongoDB doesn't run using the default port or is not running on localhost.\n\n##### Usage (with cURL)\n\n###### 0 - Create a client\n\nFirst of all you need to create a client in the clients collection, for example, with the mongo shell. The client should have a clientId and a clientSecret.\nFor example:\n{\"clientId\" : \"test\", \"clientSecret\" : \"secret\"}\n\n###### 1 - Get an access token\n\n```\ncurl -v -H \"Content-Type: application/json\" -X POST \u003cIP\u003e:\u003cPORT\u003e/oauth/token -u \u003cclientId\u003e:\u003cclientSecret\u003e -d '{\"grant_type\": \"client_credentials\"}'\n```\n\n###### 2 - Access a restricted resource using the access token\n\n```\ncurl -X GET \u003cIP\u003e:\u003cPORT\u003e/restricted -v -H \"Authorization: Bearer \u003caccessToken\u003e\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freneweb%2Foauth2orize_client_credentials_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freneweb%2Foauth2orize_client_credentials_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freneweb%2Foauth2orize_client_credentials_example/lists"}