π 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)
- Enter the address of the page where the result will be received after login completion. (Example: https://my-site.com/elice/ouath/okay)
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
Method | Request URL | Response Type | Description |
---|---|---|---|
GET | https://{ELICE_WEB_URL}/oauth/authorize | URL Redirect | Elice login authentication request |
Request Parameter Information
Request Parameter Name | Type | Required | Default Value | Description |
---|---|---|---|---|
client_id | string | Y | - | Client ID obtained during application registration |
redirect_uri | string | Y | - | One of the Redirect URI values entered during application registration (URL encoding required) |
state | string | Y | - | A random string value generated anew for security purposes |
scope | string | Y | read | A comma-separated list of permissions |
lang | string | Y | ko | Value 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
Method | Request URL | Response Type | Description |
---|---|---|---|
POST | https://{ELICE_SERVER_URL}/oauth/token | json | Access token issuance request |
Request Parameter Information
Request Parameter Name | Type | Required | Default Value | Description |
---|---|---|---|---|
client_id | string | Y | - | Client ID obtained during application registration |
client_secret | string | Y | - | Client Secret obtained during application registration |
code | string | Y | - | 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
Field | Type | Description |
---|---|---|
access_token | string | Access 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
Method | Authentication | Request URL | Response Type | Description |
---|---|---|---|---|
GET | OAuth2.0 | https://{ELICE_SERVER_URL}/oauth/account | JSON | Retrieve 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 Name | Description |
---|---|
Authorization | Value 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
Field | Type | Required | Description |
---|---|---|---|
id | String | Y | User identifier |
fullname | String | Y | User's full name |
String | Y | User's email address | |
phone | String | Y | User's phone number |
profile_url | String | Y | User's profile picture URL |
locale | String | Y | User'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"
}