SSO_SYNC not working

As per

You have to use the following:

$api_username = 'system';