# Zoom (/docs/authentication/zoom)

Zoom 提供者的设置和使用。



<Steps>
  <Step>
    ### 从 Marketplace 创建 Zoom 应用 [#从-marketplace-创建-zoom-应用]

    1. 访问 [Zoom Marketplace](https://marketplace.zoom.us)。

    2. 将鼠标悬停在 `Develop` 按钮上并选择 `Build App`

    3. 选择 `General App` 并点击 `Create`
  </Step>

  <Step>
    ### 配置你的 Zoom 应用 [#配置你的-zoom-应用]

    确保你位于应用设置的 `Basic Information` 页面。

    1. 在 `Select how the app is managed` 中，选择 `User-managed`

    2. 在 `App Credentials` 下，复制你的 `Client ID` 和 `Client Secret` 并存储在安全的位置

    3. 在 `OAuth Information` -> `OAuth Redirect URL` 中，添加你的回调 URL。例如，

       ```
       http://localhost:3000/api/auth/callback/zoom
       ```

       <Callout>
         对于生产环境，你应该将其设置为应用程序的 URL。如果更改了认证路由的基本路径，你需要相应地更新重定向 URL。
       </Callout>

    转到 `Scopes` 部分，然后

    1. 点击 `Add Scopes` 按钮
    2. 搜索 `user:read:user`（查看用户）并选择它
    3. 添加应用程序需要的其他范围并点击 `Done`
  </Step>

  <Step>
    ### 配置提供者 [#配置提供者]

    要配置提供者，你需要导入该提供者并将其传递给认证实例的 `socialProviders` 选项。

    ```ts title="auth.ts"
    import { betterAuth } from "better-auth"

    export const auth = betterAuth({
      socialProviders: {
        zoom: { // [!code highlight]
          clientId: process.env.ZOOM_CLIENT_ID as string, // [!code highlight]
          clientSecret: process.env.ZOOM_CLIENT_SECRET as string, // [!code highlight]
        }, // [!code highlight]
      },
    })
    ```
  </Step>

  <Step>
    ### 使用 Zoom 登录 [#使用-zoom-登录]

    要使用 Zoom 登录，你可以使用客户端提供的 `signIn.social` 函数。
    你需要将 `zoom` 指定为提供者。

    ```ts title="auth-client.ts"
    import { createAuthClient } from "better-auth/client"
    const authClient =  createAuthClient()

    const signIn = async () => {
      const data = await authClient.signIn.social({
        provider: "zoom"
      })
    }
    ```
  </Step>
</Steps>

