giteshk / smartdocs_oauth_additions

Apache License 2.0
3 stars 3 forks source link

Generate token results in "something went wrong" message box #8

Open alexeypirozhnikov opened 6 years ago

alexeypirozhnikov commented 6 years ago

Looking into the logs of site I see the following:

  1. (before attempt to authorize) Notice: Undefined variable: api_products in smartdocs_oauth_additions_form() (line 63 of /srv/bindings/655c325e12904974bcdef119a9c6c75d/code/modules/smartdocs_oauth_additions-master/smartdocs_oauth_additions.module).
  2. (before attempt to authorize)Warning: array_intersect(): Argument #1 is not an array in {closure}() (line 66 of /srv/bindings/655c325e12904974bcdef119a9c6c75d/code/modules/smartdocs_oauth_additions-master/smartdocs_oauth_additions.module).
  3. (after attempt to authorize and message box shown) HTTP/1.1 404 Not Found .... {..., ."message" : "TemplateAuth with the given name OAuth2 does not exists for Organization navico-prod, Api 75d6a5d1-abd9-471b-b50e-a238e8861f6e.", ..}
alexeypirozhnikov commented 6 years ago

from ApiGee support:

looked into that line in my text editor (line 63). I noticed on that line that it makes a call to $api_products, however that variable is not defined anywhere. Unfortunately, this out of the scope of Apigee Support

so, can anyone please help with this?

alexeypirozhnikov commented 6 years ago

so, it was as simple as to declare missing variable:

$api_products = array();

brmanj commented 6 years ago

I added above mentioned code but still getting the same error is there any other workaround

alexeypirozhnikov commented 6 years ago

In my case I also had callback url of the security scheme empty.

To check:

  1. In Admin mode go to content/smartdocs
  2. Select your API and at the right side choose "Settings" command
  3. Take a look at "Template authentication schemes" group, if there is no callback url shown there, then simply press "Save template auth settings" button.
taufiqa80 commented 5 years ago

I still get an error saying Invalid API call as no apiproduct match found even though I got the access token. What could be wrong? If I use the same access token in postman it works fine