Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59275

coding_error displayed on login through Facebook when account has been created using a mobile number

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.3
    • 3.3.1
    • Authentication
    • MOODLE_33_STABLE
    • MOODLE_33_STABLE
    • MDL-59275-master
    • Easy
    • Hide
      1. Create a sample FB app: https://docs.moodle.org/33/en/OAuth_2_Facebook_service
      2. Create a FB account using your mobile number.
      3. If your FB account is different from the account you used for FB app, assign the FB account with a Tester Role to the your FB App.
      4. Enable OAuth2 authentication plugin on your Moodle site.
      5. Go to Site administration / Server / OAuth 2 services and create a new Facebook service.
      6. Enter your FB app's App ID and Secret to the Client ID and secret fields.
      7. Go to your moodle site login page and click facebook login.
      8. Make sure you are redirected back and you see a error message (not coding error)
        The user information returned did not contain a username and email address. The OAuth 2 service may be configured incorrectly.
      Show
      Create a sample FB app: https://docs.moodle.org/33/en/OAuth_2_Facebook_service Create a FB account using your mobile number . If your FB account is different from the account you used for FB app, assign the FB account with a Tester Role to the your FB App. Enable OAuth2 authentication plugin on your Moodle site. Go to Site administration / Server / OAuth 2 services and create a new Facebook service. Enter your FB app's App ID and Secret to the Client ID and secret fields. Go to your moodle site login page and click facebook login. Make sure you are redirected back and you see a error message (not coding error) The user information returned did not contain a username and email address. The OAuth 2 service may be configured incorrectly.

    Description

      Getting the following error when logging in through Facebook using a Facebook account that has been created using a mobile number.

      Coding error detected, it must be fixed by a programmer: The 'username' value must be set in other.
       
      More information about this error
       
      ×Debug info: 
      Error code: codingerror
      ×Stack trace:
      line 112 of /lib/classes/event/user_login_failed.php: coding_exception thrown
      line 272 of /lib/classes/event/base.php: call to core\event\user_login_failed->validate_data()
      line 372 of /auth/oauth2/classes/auth.php: call to core\event\base::create()
      line 49 of /auth/oauth2/login.php: call to auth_oauth2\auth->complete_login()
      ×Output buffer: <br /> <b>Notice</b>: Undefined index: username in <b>/home/jun/moodles/im_review/moodle/auth/oauth2/classes/auth.php</b> on line <b>371</b><br />
      

      This issue has initially been raised in the forums: https://moodle.org/mod/forum/discuss.php?d=354142

      To reproduce:

      1. Create a sample FB app: https://docs.moodle.org/33/en/OAuth_2_Facebook_service
      2. Create a FB account using your mobile number.
      3. If your FB account is different from the account you used for FB app, assign the FB account with a Tester Role to the your FB App.
      4. Enable OAuth2 authentication plugin on your Moodle site.
      5. Go to Site administration / Server / OAuth 2 services and create a new Facebook service.
      6. Enter your FB app's App ID and Secret to the Client ID and secret fields.
      7. Login to Moodle using your Facebook account.
      8. Expected:
        • After the FB authentication process, you should be redirected back to Moodle and get logged in.
      9. Actual:
        • The error message above is encountered.

      Attachments

        Activity

          People

            lameze Simey Lameze
            jpataleta Jun Pataleta
            Ankit Agarwal Ankit Agarwal
            Jake Dallimore Jake Dallimore
            Mark Nelson Mark Nelson
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10/Jul/17