Note: If you get an error Invalid Authorization when you try Test Connection from the IdP then it might be the case that Authorization Header is missing from the request. This error may occur because of server environment, your server may removed your Authorization header due to security reasons.
If you are using Apache server then put the below line in your htaccess file after the RewriteBase.