Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Oauth2 authentication: Difference between revisions

From MoodleDocs
No edit summary
Line 20: Line 20:
* [https://developers.google.com/accounts/docs/OAuth2 Google Oauth2]
* [https://developers.google.com/accounts/docs/OAuth2 Google Oauth2]
* [https://developers.facebook.com/docs/authentication/ Facebook Oauth2]
* [https://developers.facebook.com/docs/authentication/ Facebook Oauth2]
* [http://msdn.microsoft.com/en-us/library/live/hh243647.aspx Microsoft Live Oauth2]
* [https://dev.twitter.com/docs/anywhere/welcome Twitter JS authentication]
* [https://dev.twitter.com/docs/anywhere/welcome Twitter JS authentication]
* [https://developer.linkedin.com/documents/getting-started-javascript-api Linkedin JS authentication]
* [https://developer.linkedin.com/documents/getting-started-javascript-api Linkedin JS authentication]

Revision as of 04:15, 14 August 2012

This document describes the functional and technical specification of Moodle Oauth2 plugin(s). Oauth2 plugin(s) will allow a user to authenticate in Moodle with a identity provider that implement Oauth2, like Google or Facebook.

What is Oauth2

OAuth is a security protocol that enables users to grant third-party access (i.e. Moodle) to their web resources (i.e Google/Facebook/...'s user data) without sharing their passwords.

See also

What are the user's benefits

  • The user can connect in Moodle with a Google/Facebook/... account.
  • Login is fast: 1 click on a Google/Facebook/... button.
  • The user does not need to remember a password for Moodle.
  • The user can link an existing Moodle account to an Oauth2 identity provider. Thus the user benefits of the above points.
  • When the user is new, the creation process is faster: in the best case, which is the case for Facebook/Google, every mandatory user fields are pre filled.

Why implementing Oauth2 which is still in Draft version

The main reason we choose Oauth2 is that massive identity providers as Google already started to deprecate Oauth1 or only use Oauth2 (Facebook). Oauth2 has also for benefit over Oauth1 to be simpler to implement for the client. However at the moment, Oauth2 is on a rocky road. The specification are still marked as Draft, and major providers as Facebook or Google implement their own version. But at the end these implementations are globally similar, and we will be able to reuse a major part of our code for each providers.

See also

What about Oauth1

Actually we will have to implement it as well as some big identity provider as Twitter or Linkedin only offer Oauth1.

See also

Functional specification

User

User authenticates for the first time in Moodle

User already has an account

The email address sent by the identity provider is known by Moodle

The email address is unknown

Administration

The administrator wants to:

  • enable the plugin(s)
  • set Oauth2 client id / Oauth2 client secret
  • allow user account creation
  • set lockable fields
  • deny email addresses
  • bypass the deny email addresses global settings (for example allow hotmail registration by Oauth2 but disallow it for manual to avoid spammer)
  • allow email addresses

Technical specification

One plugin by provider or One plugin for all providers

One plugin by provider

Pros

  • it works nice with lang file and Amos without additional code. Each providers use its own vocabulary (client id/app id) and need its own explanation on how to set it up.

Cons

One plugin for all providers

Pros

  • less click to setup for the administrator. Only enable one plugin.

Cons

  • the settings page could become bigger and messier.
  • need an additional "enable" checkbox for each providers (so the administrator can disable the plugin without losing the settings)
  • administratosr do not know which Oauth2 provider is enabled without looking into the Oauth2 plugin.

Multiple authentication support