Shindig
  1. Shindig
  2. SHINDIG-1387

Signature of getSecurityToken in BasicOAuthLookupService does not match base class OAuthLookupService

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-RC2
    • Component/s: None
    • Labels:
      None

      Description

      Patch:

      Index: php/src/common/sample/BasicOAuthLookupService.php
      ===================================================================
      27c27
      < public function getSecurityToken($oauthRequest, $appUrl, $userId) {

      > public function getSecurityToken($oauthRequest, $appUrl, $userId, $contentType) {

        Activity

        Hide
        Paul Lindner added a comment -

        already in trunk:

        commit f95a63362501599ef51afdb2170124eec0d125d6
        Author: Chris Chabot <chabotc@apache.org>
        Date: Mon Apr 6 18:47:00 2009 +0000

        Re-enables the exception on unsupported content-type and adds the content-type to the oauth lookup service call

        git-svn-id: https://svn.apache.org/repos/asf/incubator/shindig/trunk@762451 13f79535-47bb-0310-9956-ffa450edef68

        Show
        Paul Lindner added a comment - already in trunk: commit f95a63362501599ef51afdb2170124eec0d125d6 Author: Chris Chabot <chabotc@apache.org> Date: Mon Apr 6 18:47:00 2009 +0000 Re-enables the exception on unsupported content-type and adds the content-type to the oauth lookup service call git-svn-id: https://svn.apache.org/repos/asf/incubator/shindig/trunk@762451 13f79535-47bb-0310-9956-ffa450edef68
        Hide
        Bastian Hofmann added a comment -

        If I have a look into the current trunk the BasicOAuthLookupService still is wrong:

        /**

        • Basic implementation of OAuthLookupService using BasicOAuthDataStore.
          */
          class BasicOAuthLookupService extends OAuthLookupService {

        public function getSecurityToken($oauthRequest, $appUrl, $userId)

        { return new OAuthSecurityToken($userId, $appUrl, $this->getAppId($appUrl), "samplecontainer"); }

        private function getAppId($appUrl)

        { return 0; // a real implementation would look this up }

        }

        https://svn.apache.org/repos/asf/shindig/trunk/php/src/common/sample/BasicOAuthLookupService.php

        Show
        Bastian Hofmann added a comment - If I have a look into the current trunk the BasicOAuthLookupService still is wrong: /** Basic implementation of OAuthLookupService using BasicOAuthDataStore. */ class BasicOAuthLookupService extends OAuthLookupService { public function getSecurityToken($oauthRequest, $appUrl, $userId) { return new OAuthSecurityToken($userId, $appUrl, $this->getAppId($appUrl), "samplecontainer"); } private function getAppId($appUrl) { return 0; // a real implementation would look this up } } https://svn.apache.org/repos/asf/shindig/trunk/php/src/common/sample/BasicOAuthLookupService.php
        Hide
        Paul Lindner added a comment -

        ah, you had a reverse patch there.. so the solution is to remove the contentType from the signature?

        Show
        Paul Lindner added a comment - ah, you had a reverse patch there.. so the solution is to remove the contentType from the signature?
        Hide
        Bastian Hofmann added a comment -

        https://svn.apache.org/repos/asf/shindig/trunk/php/src/common/OAuthLookupService.php

        has the $contenType parameter

        https://svn.apache.org/repos/asf/shindig/trunk/php/src/common/sample/BasicOAuthLookupService.php

        hasn't

        if i understand chris' commit message correctly and if you look in the ApiServlet which uses the LookupService you see that it is used like this:

        $oauthLookupService = Config::get('oauth_lookup_service');
        $oauthLookupService = new $oauthLookupService();
        $token = $oauthLookupService->getSecurityToken($request, $appUrl, $userId, $this->getContentType());

        So that means the $contentType parameter should be added to the BasicOAuthLookupService as well

        https://svn.apache.org/repos/asf/shindig/trunk/php/src/social/servlet/ApiServlet.php

        Show
        Bastian Hofmann added a comment - https://svn.apache.org/repos/asf/shindig/trunk/php/src/common/OAuthLookupService.php has the $contenType parameter https://svn.apache.org/repos/asf/shindig/trunk/php/src/common/sample/BasicOAuthLookupService.php hasn't if i understand chris' commit message correctly and if you look in the ApiServlet which uses the LookupService you see that it is used like this: $oauthLookupService = Config::get('oauth_lookup_service'); $oauthLookupService = new $oauthLookupService(); $token = $oauthLookupService->getSecurityToken($request, $appUrl, $userId, $this->getContentType()); So that means the $contentType parameter should be added to the BasicOAuthLookupService as well https://svn.apache.org/repos/asf/shindig/trunk/php/src/social/servlet/ApiServlet.php
        Hide
        Paul Lindner added a comment -

        fixed.

        Show
        Paul Lindner added a comment - fixed.

          People

          • Assignee:
            Unassigned
            Reporter:
            Bastian Hofmann
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development