> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://www.openfort.io/api/mcp` to find what you need.
>
> **Have feedback?** Use `submit_feedback` on the same MCP server.

# LINE Login

Integrate LINE Login into your web app (website) to make it easier for people to create an account and log in.

## Overview

Setting up LINE login for your application consists of 3 parts:

* Create and configure a LINE Project and App on the [LINE Dashboard](https://developers.line.biz/console/).
* Add your LINE `Channel ID` and `Channel Secret` to your [Openfort Project](https://dashboard.openfort.io/providers).
* Add the login code to your app. See [Add social login to your app](https://www.openfort.io/docs/configuration/social-login#add-social-login-to-your-app) for React, React Native, JavaScript, and Swift.

<img width="70%" height="70%" src="https://www.openfort.io/images/blog/Line_auth_7891fd38a0.png" alt="LINE Auth" />

### Configuration

1. In the [LINE Developers Console](https://developers.line.biz/console/), create a provider and add a **LINE Login** channel to it.
2. Copy the channel's `Channel ID` and `Channel Secret`.
3. Register Openfort's callback URL on the channel: `https://api.openfort.io/iam/v2/auth/callback/line`.
4. In the [Openfort dashboard](https://dashboard.openfort.io/providers), enable LINE and paste the Channel ID and Channel Secret. Providers are configured per environment, so repeat this for each environment you ship to.

## Sign in with LINE

Once the provider is enabled, start the flow with `OAuthProvider.LINE`:

:::code-group
```tsx [React]
import { OAuthProvider, useOAuth } from '@openfort/react'

const { initOAuth } = useOAuth()

const loginWithLine = () => initOAuth({ provider: OAuthProvider.LINE })
```

```ts [JavaScript]
import { OAuthProvider } from '@openfort/openfort-js'

const url = await openfort.auth.initOAuth({
  provider: OAuthProvider.LINE,
  redirectTo: 'https://your-app.com/auth/callback',
})
window.location.href = url
```
:::

`initOAuth` returns the provider URL in the JavaScript SDK, and redirects for you in React. Linking LINE to an already signed-in user uses the same enum through `linkOauth`. See [`useOAuth`](https://www.openfort.io/docs/products/embedded-wallet/react/hooks/useOAuth) for the full return type, and [Add social login to your app](https://www.openfort.io/docs/configuration/social-login#add-social-login-to-your-app) for React Native and Swift.

## Verify it worked

Run the flow end to end: after the redirect completes, the user's [linked accounts](https://www.openfort.io/docs/products/embedded-wallet/react/hooks/useUser) include an entry whose `provider` is `line`. If the flow stops before LINE's consent screen, see [Invalid CallbackURL error](https://www.openfort.io/docs/configuration/social-login#invalid-callbackurl-error) — the `redirectTo` value must be a valid URL for your application, and the provider must be enabled in the environment matching your publishable key.
