Log In via Authorization Code

Log in to Application Portal by using the Single Sign-On authorization code.

Request Format

POST https://{apigw-address}/app-portal-service/v2.2/loginViaCode

Request Parameters (Body)

Name Mandatory/Optional Data Type Description
code Mandatory String The authorization code.

Response Parameters

Name Data Type Description
data Data Struct The details of the user.

Data Struct

Name Data Type Description
organizations Array of IdNamePair Structs The list of organizations that the user belongs to.
user IdNamePair Struct The ID and name of the user.

IdNamePair Struct

Name Data Type Description
id String The organization/user ID.
name String The organization/user name.

Error Code

Code Description
31400 Invalid authorization code.
31429 Accessing with incorrect password or IP attempt limit reached. Please try again later.

Samples

Request Sample

url: https://{apigw-address}/app-portal-service/v2.2/loginViaCode
method: POST
requestBody:
{"code":"authorizationCode"}

Return Sample

{
  "code": 0,
  "data": {
    "accessToken": "APP_PORTAL_S_WX89rC4pqsMc478tyP6gb9zFmT9qYaW7",
    "organizations": [
      {
        "id": "yourOrgId_1",
        "name": "Portal Demo"
      },
      {
        "id": "yourOrgId_2",
        "name": "rm_0726_001"
      }
    ],
    "user": {
      "id": "yourUserId",
      "name": "portal_demo"
    }
  },
  "message": ""
}

Java SDK Sample

public class AppPortalSdkTest{
    @Test
    public void loginViaAuthorizationCodeTest(){
        LoginViaCodeRequest request=new LoginViaCodeRequest("your_code");
        LoginViaCodeResponse response=getPoseidon().getResponse(request,LoginViaCodeResponse.class);
        assertNotNull("response data should not be null", response.data);
    }
}