• I found something else that is not working quite as expected…

    The userID from WP is not saved into the DB on the push server…

    I tracked back and can see that the userID is set properly in the SafariPushParams

    But on the server side

    $userid = "";
    	foreach(apache_request_headers() as $header=>$value) { // this is the authorization key we packaged in the website.json pushPackage
    		if($header == "Authorization") {
    			$value = explode("_", $value);
    			if(isset($value[1]) && $value[1] >0) $userid = filter_var($value[1], FILTER_SANITIZE_NUMBER_INT);
    			break;
    		}
    	}

    There is no header named “Authorization”…

    I’m not exactly sure if the userID should be in there and the issue is coming from the plugin side not sending the info or the script on the push server not looking in the right place…

    Any idea what’s going on there?

    Thanks

    https://www.ads-software.com/plugins/safari-push/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter MuViMoTV

    (@muvimotv)

    Ok well i figured that one out on my own ??

    The issue is not with the plugin or the push server per se…

    Adding the following to .htaccess solved the issue for me…

    RewriteEngine on
    RewriteCond %{HTTP:Authorization} ^(.*)
    RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
    Plugin Author macgamer

    (@macgamer)

    The “Authorization” header is something Apple sends when requesting a key to be added. Are you sure you needed to make that change? It worked out of the box for me.

    Thread Starter MuViMoTV

    (@muvimotv)

    It was not working for me so i added a error_log to get the list of all the header and the Authorization was not in there…

    After about an hour of looking here and there i found this https://stackoverflow.com/questions/13387516/authorization-header-missing-in-django-rest-framework-is-apache-to-blame

    And other articles also commenting on the issue where this header is not passed to php

    After adding these lines to .htaccess the header just “magically” appeared and fixed the issue for me…

    Plugin Author macgamer

    (@macgamer)

    Did you try WSGIPassAuthorization On instead?
    I’m a bit hesitant to change the htaccess like that because it might break something else.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘userID not saved in DB’ is closed to new replies.