# LINE Profile+

Use of optional functions requires an application

Only corporate users who have submitted the required applications can use the functions described in this document. To use the information registered with LINE Profile+ via LINE Login, LIFF App, or LINE MINI App, contact your sales representative or our Sales partners (opens new window).

LINE Profile+ is a service for managing the profile information of LINE users. The information that users register with LINE Profile+ (name, gender, birthday, address, telephone number) differs from profile information and can only be obtained by corporate users who have undergone the application process.

# Get user data registered with LINE Profile+

You can get information registered with LINE Profile+ by using either the LIFF app or LINE MINI App, or by integrating LINE Login into your own web app.

Use the following steps to specify the scopes of information you want to obtain, and to get the payload of the ID token containing LINE Profile+ information.

Step via LIFF App or LINE MINI App via LINE Login
1. Specify scopes Specify scopes on LINE Developers Console Specify scopes for authorization URL
2. Get ID token payload Get ID token payload via liff.getDecodedIDToken() Validate ID token obtained when issuing access token to get ID token payload
3. Get LINE Profile+ Information Get LINE Profile+ information from ID token payload Get LINE Profile+ information from ID token payload

# via LIFF App or LINE MINI App

To get information registered with LINE Profile+ via LIFF App or LINE MINI App, set the scopes of information you want to obtain on the LINE Developers Console, then get ID token payload, and you will be able to obtain the LINE Profile+ information of currently logged-in users.

# 1. Specify scopes on LINE Developers Console

Specify the scopes of information you want to obtain in advance. Select the target channel on the LINE Developers Console, and from the Scope section under the LIFF tab, check the scope(s) you would like to use.

For more information on the scopes you can get via LINE Profile+, see LINE Profile+ scopes.

profile plus scope

Specify openid at the same time

To get information registered with LINE Profile+, an ID token is required. Specify openid for requesting permission to get the ID token at the same time.

# 2. Get ID token payload via liff.getDecodedIDToken()

When you execute the liff.getDecodedIDToken() method of the LIFF SDK, you can get a payload of decoded ID token that contains LINE Profile+ information of currently logged-in users of the LIFF App or the LINE MINI App.

Example code for getting ID token payload:

liff.init(() => {
  const idToken = liff.getDecodedIDToken();
  console.log(idToken); // print decoded idToken object
});

# 3. Get LINE Profile+ information from ID token payload

Verify the LINE Profile+ information in the ID token payload obtained from step 2.

Example of LINE Profile+ information:

"given_name": "LINE",
"middle_name": "L",
"family_name": "Taro",
"gender": "male",
"birthdate": "1990-01-01",
"phone_number": "+81901111....",
"address": {
    "postal_code": "1028282",
    "region": "Tokyo",
    "locality": "Kioicho, Chiyoda-ku",
    "street_address": "1-3",
    "country": "JP"
}

For more information on LINE Profile+ information included in ID token, see LINE Profile+ information included in ID token.

# via LINE Login

You can obtain information registered with LINE Profile+ by integrating LINE Login v2.1 into your web app and using an ID token.

This page only contains additional information on using LINE Profile+. For more details about how to integrate LINE Login v2.1, see Integrating LINE Login with your web app.

Note

LINE Profile+ is not compatible with LINE Login v2.0 or earlier.

# 1. Specify scopes for authorization URL

Specify dedicated scopes for the authorization URL scope parameter.

For more information on the scopes you can get via LINE Profile+, see LINE Profile+ scopes.

The following is an example of an authorization URL with query parameters:

https://access.line.me/oauth2/v2.1/authorize?response_type=code&client_id=1234567890&redirect_uri=https%3A%2F%2Fexample.com%2Fauth%3Fkey%3Dvalue&state=123abc&scope=openid%20profile%20real_name%20gender%20birthdate%20phone%20address&bot_prompt=normal&nonce=0987654asd
Specify openid at the same time

To get information registered with LINE Profile+, an ID token is required. Specify openid for requesting permission to get the ID token at the same time.

For more information about the operation after the user accesses the authorization URL, see Authentication process.

# 2. Validate ID token obtained when issuing access token to get ID token payload

Information registered with LINE Profile+ is included in the ID token. The ID token is included in the response when issuing the access token.

Request example:

curl -v -X POST https://api.line.me/oauth2/v2.1/token \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=authorization_code' \
-d 'code=b5fd32eacc791df' \
--data-urlencode 'redirect_uri=https://example.com/auth?key=value' \
-d 'client_id=12345' \
-d 'client_secret=d6524edacc8742aeedf98f'

ID tokens obtained via Issue access token are encoded in Base64 format (e.g. eyJhbGciOiJIUzI1NiJ9...). You can get ID token payload decoded in JSON format by executing Verify ID token.

Request example:

curl -v -X POST 'https://api.line.me/oauth2/v2.1/verify' \
 -d 'id_token=eyJraWQiOiIxNmUwNGQ0ZTU2NzgzYTc5MmRjYjQ2ODRkOD...' \
 -d 'client_id=1234567890'

# 3. Get LINE Profile+ information from ID token payload

Verify the LINE Profile+ information in the ID token payload obtained from step 2.

Example of LINE Profile+ information:

"given_name": "LINE",
"middle_name": "L",
"family_name": "Taro",
"gender": "male",
"birthdate": "1990-01-01",
"phone_number": "+81901111....",
"address": {
    "postal_code": "1028282",
    "region": "Tokyo",
    "locality": "Kioicho, Chiyoda-ku",
    "street_address": "1-3",
    "country": "JP"
}

For more information on LINE Profile+ information included in ID token, see LINE Profile+ information included in ID token.

# LINE Profile+ scopes

These are the scopes of information you can obtain via LINE Profile+:

  • real_name: Authority to obtain the "name" registered by the user
  • gender: Authority to obtain the "gender" registered by the user
  • birthdate: Authority to obtain the "birthdate" registered by the user
  • phone: Authority to obtain the "phone number" registered by the user
  • address: Authority to obtain the "address" registered by the user
Note

It is necessary to apply for the scope to be used in advance.

# LINE Profile+ information included in ID token

The payload of the ID token you acquired through either the LIFF App or LINE MINI App, or through LINE Login, contains information from the specified scope of LINE Profile+.

# Payload

When using LINE Profile+, the following properties are added to the ID token.

Properties Type Description Scope that requires authorization
given_name String First name real_name
given_name_pronunciation String Kana of first name real_name
middle_name String Middle name real_name
family_name String Last name real_name
family_name_pronunciation String Kana of last name. It is katakana. real_name
gender String "male", "female", or a value entered by users gender
birthdate String Birthdate. The format follows the RFC3339 protocol (opens new window). birthdate
phone_number String Phone number. The format follows the E.164. phone
address Object Address object address
# Address object

You can register up to 10 addresses to LINE Profile+. For ID tokens, you can get only one recently updated or used address.

Field Type Description
postal_code String Postal code. Single byte numbers with no hyphens. This is optional so may be left blank in some cases.
region String State or province
locality String City
street_address String The value entered in "Street" and "Other". "Street" and "Other" are separated by a line break code (/n). This is optional so may be left blank in some cases.
country String Country name. Notation in line with ISO 3166-1 alpha-2.

# Payload example

{
  "iss": "https://access.line.me",
  "sub": "U272cada9c6f4c0c933b0713bc2f90f68",
  "aud": "1234567890",
  "exp": 1513142487,
  "iat": 1513138887,
  "name": "LINE taro",
  "picture": "https://profile.line-scdn.net/0h8pWWElvzZ19qLk3ywQYYCFZraTIdAGEXEhx9ak56MDxDHiUIVEEsPBspMG1EGSEPAk4uP01t0m5G",
  "given_name": "LINE",
  "middle_name": "L",
  "family_name": "Taro",
  "gender": "male",
  "birthdate": "1990-01-01",
  "phone_number": "+81901111....",
  "address": {
    "postal_code": "1028282",
    "region": "Tokyo",
    "locality": "Kioicho, Chiyoda-ku",
    "street_address": "1-3",
    "country": "JP"
  }
}