> 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/3d-secure/integrate-d1-sdk/get-started/5.-authentication/sdk-logout.md).

# SDK logout

### Overview

This section provides the logout step that revokes tokens pertaining to the D1 session associated with the specific `D1Task` and its corresponding `issuerId`. This API should be executed prior to logging out of the issuer application.

{% tabs %}
{% tab title="Android Java" %}
{% code title="" lineNumbers="true" %}

```java
public void logout(@NonNull D1Task d1Task) {
    D1Task.Callback<Void> callback = new D1Task.Callback<Void>() {
        @Override
        public void onSuccess(Void ignore) {
            // Proceed with subsequent flows
        }

        @Override
        public void onError(D1Exception exception) {
            // Refer to D1 SDK Integration – Error Management section
        }
    };
    d1Task.logout(callback);
}
```

{% endcode %}
{% endtab %}

{% tab title="Android Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
fun logout(d1Task: D1Task) {
    val callback: D1Task.Callback<Void?> = object : D1Task.Callback<Void?> {

        override fun onSuccess(ignore: Void?) {
            // Proceed with subsequent flows
        }

        override fun onError(exception: D1Exception) {
            // Refer to D1 SDK Integration – Error Management section
        }
    }
    d1Task.logout(callback)
}
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code overflow="wrap" lineNumbers="true" %}

```swift
d1Task.logout() { error in
    if let error = error {
        // Refer to D1 SDK Integration – Error Management section
    } else {
        // Proceed with subsequent flows
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

### SDK logout all

This section provides the logout step that revokes **all tokens for all `D1Task`**. This API should be executed prior to logging out of the issuer application.

{% tabs %}
{% tab title="Android Java" %}
{% code title="" overflow="wrap" lineNumbers="true" %}

```java
public void logoutAll(@NonNull D1Task d1Task) {
    D1Task.Callback<Void> callback = new D1Task.Callback<Void>() {
        @Override
        public void onSuccess(Void ignore) {
            // Proceed with subsequent flows
        }

        @Override
        public void onError(D1Exception exception) {
            // Refer to D1 SDK Integration – Error Management section
        }
    };
    d1Task.logoutAll(callback);
}
```

{% endcode %}
{% endtab %}

{% tab title="Android Kotlin " %}
{% code lineNumbers="true" %}

```kotlin
fun logoutAll(d1Task: D1Task) {
    val callback: D1Task.Callback<Void?> = object : D1Task.Callback<Void?> {

        override fun onSuccess(ignore: Void?) {
            // Proceed with subsequent flows
        }

        override fun onError(exception: D1Exception) {
            // Refer to D1 SDK Integration – Error Management section
        }
    }
    d1Task.logoutAll(callback)
}
```

{% endcode %}
{% endtab %}

{% tab title="iOS" %}
{% code overflow="wrap" lineNumbers="true" %}

```swift
d1Task.logoutAll() { error in
    if let error = error {
        // Refer to D1 SDK Integration – Error Management section
    } else {
        // Proceed with subsequent flows
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/3d-secure/integrate-d1-sdk/get-started/5.-authentication/sdk-logout.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
