I figured it out! Confused Base64 and Base64URL, now I'm using the latter and it works, thanks! ("invalid_grant" is a bit misleading as an error though.)