Mattermost singlesign on oauth2 error

I had mattermost setup under one domain say foo.domain.com then we decided to switch it to chat.domain.com.

After this singlesign on broke and we are unable to login to mattermost anymore. I’m seeing the following error.

Client authentication failed due to unknown client, no client authentication included, or unsupported authentication method.