-3

Authentication between proxy server and main server

I had build proxy server in nodejs and i had also build three other main server. request goes from proxy server to other three server according to routes. i want to make communication between proxy server and other server secure. so i am planning to use HTTPS for server communication. but, i also want to perform server level authentication. i want to perform token based authentication between servers. so how can i perform token based authentication and where can i store my token on server.

osama khan
  • 25
  • 10

2 Answers2

0

Change :

if($key != $key1)

to

if($key != $key1 && !empty($value) && !empty($value1))
Hasta Dhana
  • 4,631
  • 7
  • 17
  • 26
0

The problem is explained in in the error message, i.e. you're calling a function called getTitle() on a string $value and $value1.

In your inner and outer foreach loops you're starting with a variable called $json ~ which presumably contains JSON of the form:

{"aKey": "a text item", "bKey": "b text item", "cKey": "c text item", "dKey": "d text item", "eKey": "e text item", "fKey": "f text item", "gKey": "g text item"}

As explained in the PHP docs about foreach the form:

foreach (array_expression as $key => $value)

is placing the key in $key (so "aKey") and a string in $value (so "a text item").

Strings are not objects and do not have a method called getTitle()

Craig
  • 9,165
  • 2
  • 32
  • 36