> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/get-an-access-token.md).

# アクセストークンを取得する

## 概要

の間 **トークナイゼーション**、NFCウォレットSDKはと安全なチャネルを確立します **NFC Walletバックエンド** あなたが行うとき [プロビジョニングをトリガーする](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card/trigger-provisioning.md).

SDKはこの安全なチャネルを使用して発行します **アクセストークン** 対象:

* デジタルカード **LCM**
* 取引通知

アクセストークンには有効期限があります。必要に応じて更新してください。

## SDK の統合

使用する `ProvisioningBusinessService` および **デジタルカードID** アクセストークンを取得するには。

実装する `AccessTokenListener` でトークンを受け取るために `onSuccess(...)`.

{% hint style="warning" %}
アクセストークンを機密データとして扱ってください。

ログに記録したりディスクに保存したりしないでください。
{% endhint %}

{% code title="GetAccessToken.java" %}

```java
public void getAccessToken(final String digitalCardId) {
    final ProvisioningBusinessService provisioningService =
            ProvisioningServiceManager.getProvisioningBusinessService();

    provisioningService.getAccessToken(
            digitalCardId,
            GetAccessTokenMode.REFRESH,
            new AccessTokenListener() {
                @Override
                public void onSuccess(final String digitalCardId, final String accessToken) {
                    // トークンが正常に取得されました。
                    // これを使用してLCMサービスを呼び出し、取引通知を取得します。
                }

                @Override
                public void onError(final String digitalCardId, final ProvisioningServiceError error) {
                    // エラーを処理します（例えば、データ接続がない場合）。
                }
            }
    );
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/get-an-access-token.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.
