Fixed URI encoding for clientId and parse optional client secret from config file