From 94ad81274d3847c4d870f95c69689d09153573f2 Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 27 Sep 2024 12:42:02 +0200 Subject: [PATCH 1/2] Add consistency to Omniauth keys in secrets.yml.example The keys to configure Omniauth for WordPress were only added to the production environment, so we unified all the keys across the staging and preproduction environments. --- config/secrets.yml.example | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/config/secrets.yml.example b/config/secrets.yml.example index b395b0266..b785db667 100644 --- a/config/secrets.yml.example +++ b/config/secrets.yml.example @@ -78,6 +78,15 @@ staging: # # Currently you can overwrite SMTP, SMS, manager, microsoft API, # HTTP basic, twitter, facebook, google, wordpress and security settings. + twitter_key: "" + twitter_secret: "" + facebook_key: "" + facebook_secret: "" + google_oauth2_key: "" + google_oauth2_secret: "" + wordpress_oauth2_key: "" + wordpress_oauth2_secret: "" + wordpress_oauth2_site: "" <<: *maps <<: *apis @@ -129,6 +138,9 @@ preproduction: facebook_secret: "" google_oauth2_key: "" google_oauth2_secret: "" + wordpress_oauth2_key: "" + wordpress_oauth2_secret: "" + wordpress_oauth2_site: "" <<: *maps <<: *apis From bd6bdfcff80c37089a5b33091bd096d4b8a1dc81 Mon Sep 17 00:00:00 2001 From: taitus Date: Fri, 27 Sep 2024 13:08:02 +0200 Subject: [PATCH 2/2] Improve oauth docs --- docs/en/features/oauth.md | 24 ++++++++++++++++-------- docs/es/features/oauth.md | 22 +++++++++++++++------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/docs/en/features/oauth.md b/docs/en/features/oauth.md index 8f39e32c3..934140298 100644 --- a/docs/en/features/oauth.md +++ b/docs/en/features/oauth.md @@ -1,22 +1,29 @@ # OAuth -You can configure authentication services with external OAuth suppliers, right now Twitter, Facebook and Google are supported. +You can configure authentication services with external OAuth providers, right now Twitter, Facebook, Google and Wordpress are supported. ## 1. Create an App on the platform For each platform, go to their developers section and follow their guides to create an app. -## 2. Set your Consul Democracy's url +## 2. Set the authentication URL of your Consul Democracy installation -They'll ask you for your Consul Democracy's auth URL, and as you can see running `rake routes` at your Consul Democracy repo locally: +They'll ask you for the authentication URL of your Consul Democracy installation, and as you can see running `rails routes |grep omniauth` at your Consul Democracy repo locally: ```bash -user_omniauth_authorize GET|POST /users/auth/:provider(.:format) users/omniauth_callbacks#passthru {:provider=>/twitter|facebook|google_oauth2/} + user_twitter_omniauth_authorize GET|POST /users/auth/twitter(.:format) users/omniauth_callbacks#passthru + user_twitter_omniauth_callback GET|POST /users/auth/twitter/callback(.:format) users/omniauth_callbacks#twitter + user_facebook_omniauth_authorize GET|POST /users/auth/facebook(.:format) users/omniauth_callbacks#passthru + user_facebook_omniauth_callback GET|POST /users/auth/facebook/callback(.:format) users/omniauth_callbacks#facebook + user_google_oauth2_omniauth_authorize GET|POST /users/auth/google_oauth2(.:format) users omniauth_callbacks#passthru + user_google_oauth2_omniauth_callback GET|POST /users/auth/google_oauth2/callback(.:format) users/omniauth_callbacks#google_oauth2 + user_wordpress_oauth2_omniauth_authorize GET|POST /users/auth/wordpress_oauth2(.:format) users/omniauth_callbacks#passthru + user_wordpress_oauth2_omniauth_callback GET|POST /users/auth/wordpress_oauth2/callback(.:format) users/omniauth_callbacks#wordpress_oauth2 ``` -So for example the URL for facebook application would be `yourdomain.com/users/auth/facebook/callback` +So for example the URL for Facebook application would be `yourdomain.com/users/auth/facebook/callback`. -## 3. Set key & secret values +## 3. Set the key and secret values When you complete the application registration you'll get a *key* and *secret* values, those need to be stored at your `config/secrets.yml` file: @@ -27,6 +34,7 @@ When you complete the application registration you'll get a *key* and *secret* v facebook_secret: "" google_oauth2_key: "" google_oauth2_secret: "" + wordpress_oauth2_key: "" + wordpress_oauth2_secret: "" + wordpress_oauth2_site: "" ``` - -*NOTE:* Also in the case of Google, verify that the APIs *Contacts API* and *Google+ API* are enabled for the application. diff --git a/docs/es/features/oauth.md b/docs/es/features/oauth.md index 4bd0e13ad..93c2523f8 100644 --- a/docs/es/features/oauth.md +++ b/docs/es/features/oauth.md @@ -1,20 +1,27 @@ # OAuth -Puedes configurar la autenticación con servicios externos usando OAuth, por ahora están soportados Twitter, Facebook y Google. +Puedes configurar la autenticación con servicios externos usando OAuth, actualmente se pueden utilizar Twitter, Facebook, Google y Wordpress. ## 1. Crea una aplicación en la plataforma Para cada plataforma, sigue las instrucciones en la sección de desarrolladores de su página web. -## 2. Establece la url de tu Consul Democracy +## 2. Establece la URL de autenticación de tu instalación de Consul Democracy -Te preguntarán por la URL de autenticación de tu instalación de Consul Democracy, y como podrás comprobar corriendo la tarea `rake routes` en tu repositorio local: +Te preguntarán por la URL de autenticación de tu instalación de Consul Democracy, y como podrás comprobar corriendo la tarea `rails routes |grep omniauth` en tu repositorio local: ```bash -user_omniauth_authorize GET|POST /users/auth/:provider(.:format) users/omniauth_callbacks#passthru {:provider=>/twitter|facebook|google_oauth2/} + user_twitter_omniauth_authorize GET|POST /users/auth/twitter(.:format) users/omniauth_callbacks#passthru + user_twitter_omniauth_callback GET|POST /users/auth/twitter/callback(.:format) users/omniauth_callbacks#twitter + user_facebook_omniauth_authorize GET|POST /users/auth/facebook(.:format) users/omniauth_callbacks#passthru + user_facebook_omniauth_callback GET|POST /users/auth/facebook/callback(.:format) users/omniauth_callbacks#facebook + user_google_oauth2_omniauth_authorize GET|POST /users/auth/google_oauth2(.:format) users omniauth_callbacks#passthru + user_google_oauth2_omniauth_callback GET|POST /users/auth/google_oauth2/callback(.:format) users/omniauth_callbacks#google_oauth2 + user_wordpress_oauth2_omniauth_authorize GET|POST /users/auth/wordpress_oauth2(.:format) users/omniauth_callbacks#passthru + user_wordpress_oauth2_omniauth_callback GET|POST /users/auth/wordpress_oauth2/callback(.:format) users/omniauth_callbacks#wordpress_oauth2 ``` -Por ejemplo para facebook la URL sería `yourdomain.com/users/auth/facebook/callback` +Por ejemplo para Facebook la URL sería `yourdomain.com/users/auth/facebook/callback`. ## 3. Establece la clave y secreto @@ -27,6 +34,7 @@ Cuando completes el registro de la aplicación en su plataforma te darán un *ke facebook_secret: "" google_oauth2_key: "" google_oauth2_secret: "" + wordpress_oauth2_key: "" + wordpress_oauth2_secret: "" + wordpress_oauth2_site: "" ``` - -*NOTA:* Además en el caso de Google, verifica que las APIs de *Contacts API* y *Google+ API* están habilitadas para tu aplicación en su plataforma.