# Business Flow

Dalam rangka pemanfaatan kolaborasi antara NLE dengan semua entitas, NLE mensyaratkan semua entitas yang terhubung menggunakan framework OAuth NLE untuk memperoleh akses data user. Berikut gambaran prosesnya :

![](/files/-MUBUr3TJs1onGktXvCX)

**Access login form**

Dalam proses awal user akan membuka halaman login platform dimana platform akan menyediakan tombol ![](file:///C:\Users\user\AppData\Local\Temp\msohtmlclip1\01\clip_image002.jpg) untuk membuka halaman Popup Window login as NLE

![](/files/-MVPIPmP4pMeNFCtB-RB)

Masing-masing platform peserta kolaborasi NLE membuat form login dengan menyertakan tombol login as nle, sesuai digambar

## **Request login form token with apikey**

Platform akan melakukan request token login form dengan memanfaatkan api service sebagai berikut :

## Get Auth API Key

<mark style="color:blue;">`GET`</mark> `https://api.beacukai.go.id/V1/NLE/AuthApiKey`

untuk mendapatkan beacukai-api-key dapat menghubungi tim NLE, dan masing-masing platform akan diberikan beacukai-api-key

#### Headers

| Name             | Type   | Description |
| ---------------- | ------ | ----------- |
| beacukai-api-key | string | api\_key    |

{% tabs %}
{% tab title="200 successfully retrieved." %}

```
{"data": {
     "namaPlatform":"TauTauBeres.id",
     "namaPerusahaan":"TauTauBeres",
     "deskripsi":"truck operator",
     "domain":"https://tautauberes.id",
     "token": "3800e1230dd35a9d822c41557a9fe2ae0c0d6e2acd45b4e83f7f7047a0a23982a8"
    }
}

```

{% endtab %}

{% tab title="403 " %}

```
{"error":"API key is not valid or is expired / revoked."}
```

{% endtab %}

{% tab title="500 Invalid" %}

```
{"error":"Something went wrong. Please try again later."}
```

{% endtab %}
{% endtabs %}

## **beacukai-api-key**

beacukai-api-key akan diberikan berbeda untuk masing-masing platform

## **Open Popup window**

Platform akan mengakses halaman login LogPass di <https://nle.kemenkeu.go.id>/seamlesslogin via pop up window dengan url sebagai berikut :

## Seamless Login

<mark style="color:blue;">`GET`</mark> `https://nle.kemenkeu.go.id/seamlesslogin/`

Platform akses URL seamlesslogin dengan&#x20;

#### Request Body

| Name  | Type   | Description                            |
| ----- | ------ | -------------------------------------- |
| token | string | access token dari respone auth api key |

{% tabs %}
{% tab title="403 " %}

```
{"error":"API key is not valid or is expired / revoked."}
```

{% endtab %}

{% tab title="500 Invalid" %}

```
{"error":"Something went wrong. Please try again later."}
```

{% endtab %}
{% endtabs %}

![](/files/-MUBYEJyFeI46QQz-5ps)

**Login**\
User akan melakukan login dengan mengisi nama user dan kata sandi kemudian menekan tombol masuk

**Request user token**\
Sistem akan melakukan request user token, apabila nama user/ kata sandi salah maka sistem akan menolak request user token

**Get user token**\
Jika nama user dan kata sandi benar sistem akan memberikan user token

**Redirect and sending user token**\
Pop up window  akan mengirimkan data user beserta user token ke halaman platform. Untuk menerima data tersebut dapat menggunakan perintah javascript sebagai berikut:

| <p><br><strong><code>window\.addEventListener('message',function(event) { if(event.origin !== '</code></strong><a href="https://nle.kemenkeu.go.id"><strong><code><https://nle.kemenkeu.go.id></code></strong></a><strong><code>') return; console.log(event.data) },false);</code></strong></p> |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><code>Output: {</code> </p><p><code>access\_token: 'au7jgjhhjgy767xxxxx865f534dd4==',</code> </p><p><code>expires\_in: 900,</code> </p><p><code>username: 'cobajualan',</code> </p><p><code>npwp: '018263453454543'</code> </p><p><code>}</code></p>                                          |

Setelah halaman platform menerima data user, platform dapat menyimpannya kedalam cookies atau metode penyimpanan lain yang memungkinkan dengan tetap mempertimbangkan keamanan data pengguna. token respon dapat digunakan untuk melakukan akses API yang telah kita sediakan di <https://nleceisa.gitbook.io/docs/apis/customs-api>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nleceisa.gitbook.io/docs/getting-started/login-as-nle/business-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
