Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-15398

Add event to oauth login after ID check

    XMLWordPrintable

Details

    • New Feature
    • Status: Unverified Fix (View Workflow)
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.2.3-RC1
    • Events

    Description

      Identifer: 
      core.oauth_login_after_check_if_provider_id_has_match

      Location:

      • /phpbb/auth/provider/oauth/oauth.php
      • in login function
      • after check if given provider id is associated with a user
      • before check if result is empty (no association found) and display of error message.

      Parameters:

      • row (the result of the query that checked if the provider id is associated with a user)
      • data (for the provider info)
      • service (to make an http request)

      Explanation:
      The current workflow automatically generates an error message if no user is associated with the given provider id.
      However, I just implemented a feature for my company's forum extension that, in case there is no association yet, automatically creates a new user and also a row in the oauth_accounts table.

      So users can now sign in via oauth on our main website, and if they don't have an account on our forum-subdomain (phpBB database), a new account will be created, a new row will be inserted into the oauth_accounts table, and they will be logged in.
      They do not have to link the account manually.

      In order to achieve this, I had to create a core hook myself and add it to the existing phpBB source code, which obviously is not great, as it could lead to potential bugs when we decide to update the software (We would have to manually re-insert the hook each time ourselves)

      It would be nice if a new hook would be added in the location I mentioned.

      The code I used looks like this:

      $vars = array(
      'row',
      'data',
      'service'
      );
      extract($this->dispatcher->trigger_event('core.oauth_login_after_check_if_provider_id_has_match', compact($vars)));

      Attachments

        Activity

          People

            Marc Marc
            watchgona watchgona [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: