Instagram has security verification that you can turn it on or off, and we what it on, its a HMAC
using the SHA256
.
This is the formula.
Token to sign: endpoint|key1=value1|key2=value2|...
Parameter name: sig
Parameter value: signed token with your Client Secret using the SHA256 hash algorithm
I placed a code in HWIOAuthBundle -> GenericOAuth2ResourceOwner - > getUserInformation
$sig = "/users/self";
$sig .= "|" . $this->options['attr_name'] . "=" . $accessToken['access_token'];
$sig = hash_hmac('sha256', $sig, $this->options['client_secret'], false);
Instagram is responding well and it works, but HWIOAuthBundle
code fails with this warning, because that was not the parameters passed from the configuration, I forced the sig=(SIGNATURE)
param.
Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent
Anyone has any clue ?
UPDATE
Scratch that, the code did work.
But, there has to be an easier way right ?