Skip to main content

Baidu

To set up Baidu OAuth provider, please read the Baidu documentation and follow their steps to complete the application creation.

Create Baidu APP

After creating your app, the redirect url is set in the following position:

Baidu URL Setting

Add your casdoor domain in the following position:

Redirect URL Setting

caution

This part is very different from the actual situation in the documentation given by Baidu:

  1. Adding the url to the callback url setting will most likely fail to validate the url and cause the login to fail, so we add our domain name to the domain setting.
  2. Only one url or domain name can be added, which is very different from the documentation.

Then you can get Client ID and Client Secrets now!

Baidu Client

Add a Baidu OAuth provider and fill the Client ID and Client Secrets in your Casdoor.

Baidu Provider

Now you can use Baidu as third party service to complete authentication!

General troubleshooting

If you encounter a Baidu prompt that your redirect url is incorrect, here are some ways you might be able to fix it:

  1. Add your domain name to the appropriate location, and then reset the Secret (Baidu reset Secret has a bug, it will prompt you an error, but after refreshing the page the Secret has been refreshed)
  2. If the above methods do not solve the problem, we suggest you delete the application and create a new one, and set your domain name first.

Another problem is that the user name returned by Baidu is masked, unlike its documentation which shows the user name and the displayed name, so we can currently only use the masked name as the user name.