Servicio OAuth 2 Linkedln

De MoodleDocs

Nota: Urgente de Traducir. ¡ Anímese a traducir esta muy importante página !.     ( y otras páginas muy importantes que urge traducir)

Configurar App en LinkedIn

Para configurar un cliente OAuth 2 con LinkedIn, ´primeramente necesitamos ingresar a LinkedIn Developers page y crear una nueva App.

Nueva App

Habilitar los permsos r_basicprofile y r_emailaddress e ingresar la URL de redirección autorizada OAuth 2. Esta es la URL de su sitioseguida por /admin/oauth2callback.php (por ejemplo, para un sitio Moodle de https://teach.me/moodle/ la callback url debería de ser https://teach.me/moodle/admin/oauth2callback.php).

Configurar App

Asegúrese de guardar los cambios y grabar su ID y secreto del cliente.

Ahora que Usted ya ha confgurado su LinkedIn App - Usted puede añadir la información necesaria a Moodle.

LinkedIn no tiene una "plantilla" en Moodle, por lo que necesitaremos sonfigurarla como un "Custom OAuth 2 Service" (Servicio OAuth 2 Personalizado). Desde la página de "Administración del sitio > Servidor > Servicios OAuth 2" haga click en "Crear nuevo servicio personalizado".

Use "LinkedIn" como el nombre (Esto es mostrado en la página para ingresar).

Ingrese su ID y secreto del cliente para la App LinkedIn que Usted creó con anterioridad.

For the "Scopes included in a login request" and "Scopes included in a login request for offline access" use "r_basicprofile r_emailaddress" which means fetch basic profile information as well as the users email address.

Enter a url to a logo image.

Check the box for "Show on login page".

Save the details and you should be returned to the list of OAuth 2 Services.

We still need to provide information on the mappings between linked in user fields and moodle fields as well as the URL's to access the LinkedIn APIs.

First we will setup the API URL's.

Click on the "Configure Endpoints" icon for the LinkedIn service.

Add 3 endpoints as listed below.

userinfo_endpoint https://api.linkedin.com/v1/people/~:(id,email-address,first-name,last-name,picture-url)?format=json

authorization_endpoint https://www.linkedin.com/oauth/v2/authorization

token_endpoint https://www.linkedin.com/oauth/v2/accessToken

Now we need to add the mapping from LinkedIn user fields to Moodle user fields. From the list of OAuth services click on the "Configure user field mappings" icon.

Add the following user field mappings:

firstName firstname lastName lastname emailAddress username emailAddress email pictureUrl picture

The final step is to make sure the OAuth 2 authentication plugin is enabled and you should now be able to login with LinkedIn.