---
title: Read-only callbacks
description: Nodes use these callbacks to return information to the client application or to display information to the user.
component: pingoneaic-api
page_id: pingoneaic-api:am-authentication:callbacks-read-only
canonical_url: https://developer.pingidentity.com/pingoneaic-api/am-authentication/callbacks-read-only.html
keywords: ["Authentication", "Callbacks", "REST API"]
section_ids:
  metadatacallback: MetadataCallback
  pollingwaitcallback: PollingWaitCallback
  RedirectCallback: RedirectCallback
  suspendedtextoutputcallback: SuspendedTextOutputCallback
  textoutputcallback: TextOutputCallback
---

# Read-only callbacks

Nodes use these callbacks to return information to the client application or to display information to the user.

## MetadataCallback

Injects key-value pairs into the authentication process.

Example

```json
{
  "callbacks": [{
    "type": "MetadataCallback",
    "output": [{
      "name": "data",
      "value": {
        "myParameter": "MyValue"
      }
    }]
  }]
}
```

Class to import in scripts: `com.sun.identity.authentication.spi.MetadataCallback`

## PollingWaitCallback

Indicates the number of milliseconds to wait before responding to the callback.

Example

```json
{
  "callbacks": [{
    "type": "PollingWaitCallback",
    "output": [{
      "name": "waitTime",
      "value": "8000"
    }, {
      "name": "message",
      "value": "Waiting for response..."
    }]
  }]
}
```

Class to import in scripts: `org.forgerock.openam.authentication.callbacks.PollingWaitCallback`

## RedirectCallback

Redirects the user-agent.

The [Social Provider Handler node](https://docs.pingidentity.com/auth-node-ref/latest/social-provider-handler.html) returns this callback when its Client Type is set to `BROWSER`, and the client must redirect the user to the social provider for authentication.

Example

```json
{
  "callbacks": [{
    "type": "RedirectCallback",
    "output": [{
      "name": "redirectUrl",
      "value": "https://accounts.google.com/o/oauth2/v2/auth?nonce..."
    }, {
      "name": "redirectMethod",
      "value": "GET"
    }, {
      "name": "trackingCookie",
      "value": true
    }]
  }]
}
```

Advanced Identity Cloud uses a `trackingCookie` to store the authentication identifier that reflects the client's place in the authentication process.

Class to import in scripts: `com.sun.identity.authentication.spi.RedirectCallback`

## SuspendedTextOutputCallback

Provides a message to display to the user when the authentication journey is suspended.

| Callback output field | Description                                                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| `message`             | A string containing a message to display to the user.                                            |
| `messageType`         | A number indicating the severity of the message:- `0`: Information

- `1`: Warning

- `2`: Error |

Example

```json
{
  "callbacks": [{
    "type": "SuspendedTextOutputCallback",
    "output": [{
      "name": "message",
      "value": "An email has been sent to your inbox."
    }, {
      "name": "messageType",
      "value": "0"
    }]
  }]
}
```

Class to import in scripts: `org.forgerock.openam.auth.node.api.SuspendedTextOutputCallback`

## TextOutputCallback

Provides a message to display to the user.

| Callback output field | Description                                                                                      |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| `message`             | A string containing a message to display to the user.                                            |
| `messageType`         | A number indicating the severity of the message:- `0`: Information

- `1`: Warning

- `2`: Error |

Example

```json
{
  "callbacks": [{
    "type": "TextOutputCallback",
    "output": [{
      "name": "message",
      "value": "Default message"
    }, {
      "name": "messageType",
      "value": "0"
    }]
  }]
}
```

Class to import in scripts: `javax.security.auth.callback.TextOutputCallback`

Learn more in [TextOutputCallback](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/javax/security/auth/callback/TextOutputCallback.html).
