Call login page
Web login is a feature that allows users to log in to the IdP through a web page.
The login page call is an API that returns a temporary authentication code (state
) along with the Hive web login URL address where the user can log in to the IdP.
After requesting the login page call API, when the user completes the web login on the called login page, a temporary authentication code (state
) is returned through the redirect URI provided during the request. The temporary authentication code (state
) is a required parameter that must be provided when making the login verification and user information retrieval API request.
Request URL¶
Environment | URL |
---|---|
Production | https://weblogin.withhive.com/login?param= |
Sandbox | https://sandbox-weblogin.withhive.com/login?param= |
HTTP Method | GET |
Content-Type | text/html |
Request Query Parameters¶
Field Name | Type | Description | Required |
---|---|---|---|
param | String | A string generated by URL encoding and BASE64 encoding the JSON object below. | Y |
Request Query Parameters JSON Structure (param
)¶
Field Name | Type | Description |
---|---|---|
appid | String | App ID |
url | String | The URI address to redirect after login is complete. It must match the Redirect URI registered in the Hive console Authentication > Authentication Settings > Login Settings. If it does not match, a 2012 error page will be displayed. |
client_id | String | The OAuth 2.0 Client ID created in the security key settings. You can check it in the Hive console App Center > Security Key Settings. |
response_type | String | OAuth 2.0 authorization method. Default: code |
country | String | The country code set in the game or community (uses browser default if not provided) |
language | String | The language code set in the game or community (uses browser default if not provided) |
Request Query Parameters JSON (param
) Example¶
Request Query Parameters JSON (param
) consists of a JSON object as shown below.
{
"appid": "com.com2us.hivesdk.ios.community.global.normal",
"url": "https://community.withhive.com/hivesdk/login/redirect",
"client_id": "58b48cd3-df47-5b52-2627-3f9c8d01",
"response_type": "code",
"country": "KR",
"language": "ko"
}
This JSON object is converted to a string in the following order during the API call and used as the param
query parameter.
- URL encoding
- BASE64 encoding
# 인코딩된 param을 붙여 호출하는 URL 예시
https://weblogin.withhive.com/login?param=JTdCJTIyYXBwaWQlMjIlM0ElMjJjb20uY29tMnVzLmhpdmVzZGsuaW9zLmNvbW11bml0eS5nbG9iYWwubm9ybWFsJTIyJTJDJTIydXJsJTIyJTNBJTIyaHR0cHMlM0ElMkYlMkZjb21tdW5pdHkud2l0aGhpdmUuY29tJTJGaGl2ZXNkayUyRmxvZ2luJTJGcmVkaXJlY3QlMjIlMkMlMjJjbGllbnRfaWQlMjIlM0ElMjI1OGI0OGNkMy1kZjQ3LTViNTItMjYyNy0zZjljOGQwMSUyMiUyQyUyMnJlc3BvbnNlX3R5cGUlMjIlM0ElMjJjb2RlJTIyJTJDJTIyY291bnRyeSUyMiUzQSUyMktSJTIyJTJDJTIybGFuZ3VhZ2UlMjIlM0ElMjJrbyUyMiU3RA==
Response Behavior¶
- The response results in an HTTP 302 Redirect.
- The browser is redirected to the URI set in the
Location
header, and theres
query parameter is added to that URI. res
is a URL-encoded and BASE64-encoded JSON string.
Redirect Location URI Sample¶
# https://community.withhive.com/hivesdk/login/redirect를 리다이렉트 URI로 설정한 경우
https://community.withhive.com/hivesdk/login/redirect?res=JTdCJTIyY29kZSUyMiUzQSUyMjEwMCUyMiUyQyUyMnN0YXRlJTIyJTNBJTIyMTY4ODEwODkyNzk0Mi1CUHVxcHFFaUd6S0lIJTIyJTdE
Response Query Parameters (res
)¶
res
is the value converted to a String after undergoing URL encoding and BASE64 encoding, consisting of a JSON object with the key values as shown below.
Field Name | Type | Description |
---|---|---|
code | String | Web login response code If not successful, it will redirect to a web login error page containing the error code. |
state | String | Temporary authorization code (authorization_code) to be used when requesting token issuance. |
Response Query Parameters response code¶
code | Description | Remarks |
---|---|---|
100 | Success | |
1050 | Invalid parameter | |
1051 | URL decoding error | |
1052 | BASE64 decoding error | |
1053 | Invalid Param value | Value of ?param= |
2005 | Abnormal request value | |
2011 | No project information | |
2012 | Redirect URI mismatch | Must match the Redirect URI registered in Hive console Authentication > Authentication Settings > Login Settings. |
2013 | Project is in a terminated state | |
2016 | No app ID information | |
2018 | No company information | |
2020 | Temporary authentication code (state ) issuance failed | |
2022 | Temporary authentication code (state ) storage failed | |
7000 | OAuth2.0 security key not generated | Check in Hive console App Center > Security Key Settings. |
7003 | No OAuth2.0 Client information | 〃 |
Response Query Parameters Sample (res
)¶
To use res
as a JSON object again, you need to perform BASE64 decoding and URL decoding in reverse. An example of a JSON object is shown below.