Share and be happy!

Since the last update of the module functional for Moodle authorization held for about six months, and even then there were ideas to improve it, but the time to put these ideas appeared only in the last few days, some of which were spent on the implementation of these ideas. It should be noted that (pah-pah) for the time the plugin is in the official Moodle plugin repository users did not have any problems working with the one, questions usually dealt with factors not related to the functional unit, and it was more of a problem with the internal configuration of their server, for example, php settings.

What has been done

Integration Yahoo OAuth 2.0 protocol support

Yahoo OAuth switcher LenAuthRecently, Yahoo has finally implemented OAuth2 protocol support, which is much easier and faster. We decided to keep support OAuth 1.0 protocol requests for those who have already successfully operate old applications and made a special versions switcher of these protocols in Yahoo settings (the way it is included in the plugin by default!), but we still strongly recommend to move your applications to OAuth 2.0 protocol.

Connecting to the Yahoo OAuth 2.0 protocol has its own features

According to the documentation, as well as in all the social networks, you need to create an application for authorization, then you must create a link with GET-parameters from the URL https://api.login.yahoo.com/oauth2/request_auth:

  • client_id — Consumer Key data from your application
  • redirect_uri — Your link that will take the code
  • response_type — should be the value code
  • stateoptional parameter that will be passed on success redirect_uri request
  • languageoptional, interface language

After receiving the code in the GET-parameter, you must use it to build the query obtain access token. To do this, you must build a POST request to the URL https://api.login.yahoo.com/oauth2/get_token with parameters:

  • client_id — Consumer Key data from your application
  • client_secret — Consumer Secret of data your application
  • redirect_uriredirect_uri the same as in the request code
  • code — parameter obtained during the initial GET-request
  • grant_type — must be authorization_code

Here, an important feature of this request is that the CURL-request header is necessary to substitute the string with base64 conversion on RFC 2617 standard, and the line should be folded by concatenating client_id:client_secret. In practice this means that in the CURL-request option CURLOPT_USERPWD must pass this way:
curl_setopt($curl_init_var, CURLOPT_USERPWD, "your_client_id_consumer_key:your_client_secret");

If request successful, the query answer will come in json format, like this:
{"access_token":"Jzxbkqqbmjerh2IMxASEE1cuaos--","token_type":"bearer","expires_in":3600,"refresh_token":"AOiRUlJn_qOmBFTQTmRpwcMKW3XDcipToOoH42wuQyWgJCfRFlA-","xoauth_yahoo_guid":"JT8FA3BQHJ2OCE"}

Parameter xoauth_yahoo_guid you will need to finalize the request to get user data. This GET-query is constructed by means of turning in the URL of your xoauth_yahoo_guid:
https://social.yahooapis.com/v1/user/YOUR_XOAUTH_YAHOO_GUID/profile?format=json

In the header you need to pass the request Authorization: Bearer YOUR_CODE

Next returns json-string that is converted to an array and LenAuth processing the one.

Arbitrary/custom buttons output order

Custom buttons order LenAuthThis idea was for a long time: give Moodle user to construct authorization buttons/links output order. Now, in LenAuth settings for each service appeared the «Order», which allows to build your buttons output order, you just need to put the serial number of the desired output button. Please note that all figures in each service must be unique, and their value should be in the range of 1 to 7. The order by default is constructed as: Facebook, Google, Yahoo, Twitter, Vkontakte, Yandex, Mail.ru.

Guest users authorization

Because the guest users are considered to be logged on, they did not show the authorization buttons is noticed Mark Samberg and plugin repository on GitHub threw Pull Request. We made it to the editing plugin, thank you, Mark!

VK API update

We have updated the version of the VK API with 5.27 to 5.33.

What will happen with the plugin

In our view, the plugin is done everything that could be done, we have no new ideas, all implemented. Therefore, we will switch to writing documentation and debugging other our Moodle plugins, which we have operating time, because we are creating / programming / developing plugins for Moodle (blocks or modules). But if you have ideas for further improvements to the plugin, you can leave your idea in the section «Issues» of our repository on GitHub, and if you are a developer and already know how to implement your idea, then throw Pull Request.

Write a comment

Your email address will not be published. Required fields are marked *

Waiting feedback for mutually beneficial cooperation

Our services are b2b-oriented. We strive for high-quality Moodle services supply as it leads to higher income and satisfaction of our clients. If you have any questions or desires, please contact us.

A pop-up window

Contact us
Programming technologies Moodle: CSS3, AngularJS, Bootstrap

© 2014–2016, «LMS-Service». All rights reserved.