Baidu OAuth
Add Baidu as an OAuth provider.
- Read Baidu Open Auth and create an application.

- Set the redirect URL in the app settings. Add your Hanzo IAM domain in the domain setting, not in the callback URL field — Baidu’s callback URL validation often fails if you put the full URL there, and only one domain or URL is allowed (unlike the docs).

:::caution
- Use the domain setting for your Hanzo IAM domain; adding the full callback URL in the callback URL field often fails validation and breaks login.
- Only one URL or domain can be added. :::
- Copy Client ID and Client Secret from the app.

- In Hanzo IAM add an OAuth provider, set Type to Baidu, and enter Client ID and Client secret.

:::info Troubleshooting
- If Baidu reports an incorrect redirect URL: add your domain in the correct place, then reset the Secret (Baidu may show an error but the secret updates after refresh). If it still fails, delete the app and create a new one, and set the domain first.
- Baidu returns a masked username; Hanzo IAM uses that masked value as the username. :::
How is this guide?
Last updated on