{"action":"created","issue":{"url":"https://api.github.com/repos/discourse/wp-discourse/issues/257","repository_url":"https://api.github.com/repos/discourse/wp-discourse","labels_url":"https://api.github.com/repos/discourse/wp-discourse/issues/257/labels{/name}","comments_url":"https://api.github.com/repos/discourse/wp-discourse/issues/257/comments","events_url":"https://api.github.com/repos/discourse/wp-discourse/issues/257/events","html_url":"https://github.com/discourse/wp-discourse/pull/257","id":193360657,"number":257,"title":"Use Discourse instance as a SSO provider","user":{"login":"iamntz","id":132062,"avatar_url":"https://avatars.githubusercontent.com/u/132062?v=3","gravatar_id":"","url":"https://api.github.com/users/iamntz","html_url":"https://github.com/iamntz","followers_url":"https://api.github.com/users/iamntz/followers","following_url":"https://api.github.com/users/iamntz/following{/other_user}","gists_url":"https://api.github.com/users/iamntz/gists{/gist_id}","starred_url":"https://api.github.com/users/iamntz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamntz/subscriptions","organizations_url":"https://api.github.com/users/iamntz/orgs","repos_url":"https://api.github.com/users/iamntz/repos","events_url":"https://api.github.com/users/iamntz/events{/privacy}","received_events_url":"https://api.github.com/users/iamntz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":37,"created_at":"2016-12-04T16:43:27Z","updated_at":"2017-02-11T23:34:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/discourse/wp-discourse/pulls/257","html_url":"https://github.com/discourse/wp-discourse/pull/257","diff_url":"https://github.com/discourse/wp-discourse/pull/257.diff","patch_url":"https://github.com/discourse/wp-discourse/pull/257.patch"},"body":"Implemented the SSO functionality as discussed [here](https://meta.discourse.org/t/using-discourse-as-a-sso-client/32974/28?u=iamntz).\r\n\r\n### What is this?\r\nAs its name states, will allow you to use a Discourse instance as a SSO provider. It works as follow:\r\n\r\n1. If you don't have an account on WP, a new account will be created (although I'm not sure what's happening if you don't have an account on discourse...) and this new account will be linked to your discourse account.\r\n1. if you do have an account on WP, discourse user will be linked to current user;\r\n\r\nClearly enough, discourse user info will be used to fill the WP user data, in order to mantain some kind of sync.\r\n\r\n### How to use\r\nYou must fill discourse URL & SSO secret, then tick the `Enable Discourse SSO` & `Add \"Login with Discourse\" on the login form` checkboxes.\r\n\r\nThis also implements a shortcode and also provides a functions & some hooks that can be used by developers.\r\n\r\nShortcode can be used either simple : `[discourse_sso]` or with params, to allow customizing default anchor texts:\r\n\r\n```\r\n[discourse_sso login=\"Login to discourse\" link=\"Link your account to discourse\"]\r\n```\r\n\r\n#### Filters\r\n\r\n```\r\napply_filters( discourse/sso/client/login_anchor', $anchor, $sso_login_url, $options, $discourse_options );\r\n```\r\nAllows you to alter default login anchor (i.e. if you want to use the shortcode in multiple place and you don't want to add the attributes every single time).\r\n\r\n```\r\n$updated_user = apply_filters( discourse/sso/client/updated_user', $updated_user, $query );\r\n```\r\nAllows you to change what data is saved from discourse payload to user meta.\r\n\r\n```\r\n$redirect_to = apply_filters( discourse/sso/client/redirect_after_login', $query['return_sso_url'] );\r\n```\r\nAllows you to specify a redirect url after successful  auth.\r\n\r\nAs a developer, you can also use `get_discourse_sso_url()` to get... well, the sso url.\r\n\r\n### Quirks, issues & stuff\r\n\r\n- Discourse doesn't send on SSO payload either an user is blocked or not, hence a blocked user will be able to log in to WP\r\n"},"comment":{"url":"https://api.github.com/repos/discourse/wp-discourse/issues/comments/279183955","html_url":"https://github.com/discourse/wp-discourse/pull/257#issuecomment-279183955","issue_url":"https://api.github.com/repos/discourse/wp-discourse/issues/257","id":279183955,"user":{"login":"scossar","id":2975917,"avatar_url":"https://avatars.githubusercontent.com/u/2975917?v=3","gravatar_id":"","url":"https://api.github.com/users/scossar","html_url":"https://github.com/scossar","followers_url":"https://api.github.com/users/scossar/followers","following_url":"https://api.github.com/users/scossar/following{/other_user}","gists_url":"https://api.github.com/users/scossar/gists{/gist_id}","starred_url":"https://api.github.com/users/scossar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scossar/subscriptions","organizations_url":"https://api.github.com/users/scossar/orgs","repos_url":"https://api.github.com/users/scossar/repos","events_url":"https://api.github.com/users/scossar/events{/privacy}","received_events_url":"https://api.github.com/users/scossar/received_events","type":"User","site_admin":false},"created_at":"2017-02-11T23:34:16Z","updated_at":"2017-02-11T23:34:16Z","body":"It seems to me that it should be safe to commit `vendor/` to git. There are some possible issues with using Composer packages in WordPress plugins: https://wptavern.com/a-narrative-of-using-composer-in-a-wordpress-plugin\r\n\r\nIf you want to rename the class files so that they work with the PRS-4 autoloader, go ahead and do it."}}
{"actor":{"display_login":"scossar"}}