There are several possible scenarios:
You are using Production Access Keys while running Sandbox endpoint URL, or vice versa;
Your Server Key is not converted yet to base64;
You have space ( ) when converting.