Skip to main content

πŸ”‘ Elice Login Integration Development Guide

This document provides a guide for integrating Elice login through OAuth.

1. Application Registration​

To integrate Elice login, you must first register the application name and Redirect URI. Please send the following information to backend@elicer.com, and we will register it internally and provide further instructions.

  • Application name
  • Redirect URI (up to 5, must be https)

After the internal registration process is completed, we will provide you with the following information:

  • client_id
  • client_secret
  • ELICE_WEB_URL (development)
  • ELICE_SERVER_URL (development)
  • ELICE_WEB_URL (production)
  • ELICE_SERVER_URL (production)

2. Creating Elice Login Integration URL​

This section introduces the API call method to redirect the user to the Elice login screen when the Elice login integration button is clicked.

By filling out the request parameters and calling the API, the user will be redirected to the Elice login screen.

Once the user logs in, they will be redirected back to the Redirect URI with the result.

Request URL Information

MethodRequest URLResponse TypeDescription
GEThttps://{ELICE_WEB_URL}/oauth/authorizeURL RedirectElice login authentication request

Request Parameter Information

Request Parameter NameTypeRequiredDefault ValueDescription
client_idstringY-Client ID obtained during application registration
redirect_uristringY-One of the Redirect URI values entered during application registration (URL encoding required)
statestringY-A random string value generated anew for security purposes
scopestringYreadA comma-separated list of permissions
langstringYkoValue for distinguishing the user language

Request Example

curl -X GET "https://\{ELICE_WEB_URL\}/oauth/authorize?client_id=myclientid&redirect_uri=redirect_uri=https%3A%2F%2Fmy-site.com%2Felice%2Fouath%2Fokay&state=om22bsq0jz&scope=read&lang=ko"

Response Example

HTTP/1.1 302 Found
Location: https://my-site.com/elice/ouath/okay?code=okaycode12345&state=om22bsq0jz

3. Access Token Issuance Request​

The authentication code (code) received through the query string when redirected to the Redirect URI is used to obtain an access token.

The authentication code is one-time use only and cannot be reused once it is used to issue an access token.

The access token is used when calling Elice REST APIs, such as the user information API.

This API must be executed on the server, not the user's browser.

Request URL Information

MethodRequest URLResponse TypeDescription
POSThttps://{ELICE_SERVER_URL}/oauth/tokenjsonAccess token issuance request

Request Parameter Information

Request Parameter NameTypeRequiredDefault ValueDescription
client_idstringY-Client ID obtained during application registration
client_secretstringY-Client Secret obtained during application registration
codestringY-The authentication code value received through the Redirect URI

Request Example

curl -X POST "https://\{ELICE_SERVER_URL\}/oauth/token" \
-H "Content-Type: application/json" \
-d '{"client_id":"myclientid","client_secret":"myclientsecret","code": "okaycode12345"}'

Response Information

FieldTypeDescription
access_tokenstringAccess token (expires after 1 hour)

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json

{
"access_token": "your_access_token"
}

4. Calling User Information API Using Access Token​

You can call the user information retrieval API using the access token.

Request URL Information

MethodAuthenticationRequest URLResponse TypeDescription
GETOAuth2.0https://{ELICE_SERVER_URL}/oauth/accountJSONRetrieve user information

Request Parameter Information

No request parameters are required. Instead, when calling the request URL, pass the access token value in the request header.

Request Header

Request Header NameDescription
AuthorizationValue in the format: Bearer {access_token}

Request Example

curl -X GET "https://\{ELICE_SERVER_URL\}/oauth/account" \
-H "Authorization: Bearer your_access_token"

Response Information

FieldTypeRequiredDescription
idStringYUser identifier
fullnameStringYUser's full name
emailStringYUser's email address
phoneStringYUser's phone number
profile_urlStringYUser's profile picture URL
localeStringYUser's locale information

Response Example​

HTTP/1.1 200 OK
Content-Type: application/json

{
"id": 12345,
"fullname": "John Doe",
"email": "john.doe@example.com",
"phone": "010-1234-5678",
"profile_url": "https://example.com/profile/johndoe",
"locale": "ko"
}