---
title: Integrating RAR into an Android app
description: Add Rich Authorization Requests (RAR) `authorization_details` to the OIDC module in an Android app, and read the granted details from the token response.
component: orchsdks
page_id: orchsdks:oidc:use-cases/rar/android/usage
canonical_url: https://developer.pingidentity.com/orchsdks/oidc/use-cases/rar/android/usage.html
llms_txt: https://developer.pingidentity.com/orchsdks/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: Tue, 4 Nov 2026 00:00:00 +0000
keywords: ["OAuth 2.0", "OpenID Connect", "Rich Authorization Requests", "RAR", "RFC 9396", "authorization_details", "Android", "Kotlin", "SDK"]
section_ids:
  requesting_authorization_details: Requesting authorization details
  rar-alongside-existing-login: Running RAR alongside an existing login
  reading_the_granted_details: Reading the granted details
  understanding_the_limitations: Understanding the limitations
  native_journeys_cannot_carry_rar: Native journeys cannot carry RAR
  device_authorization_flows_cannot_initiate_rar: Device authorization flows cannot initiate RAR
  next_steps: Next steps
---

# Integrating RAR into an Android app

[icon: circle-check, set=far]PingOne Advanced Identity Cloud [icon: circle-check, set=far]PingAM [icon: android, set=fab]Android

The Orchestration SDK for Android provides typed support for [Rich Authorization Requests (RAR, RFC 9396)](https://datatracker.ietf.org/doc/html/rfc9396) by using the **OIDC** module.

You describe what the user is approving with `AuthorizationDetail` objects, the SDK sends them as the `authorization_details` parameter, and the details the server granted are echoed back with the token.

This page shows you how to add RAR to an existing app that signs on with PingOne Advanced Identity Cloud or PingAM.

## Requesting authorization details

The first step in implementing RAR is to describe the details of what the user should authorize, so the server can present them as a rich consent. To do this, create `AuthorizationDetail` objects:

Example `AuthorizationDetail` object describing a specific payment

```kotlin
val payment = AuthorizationDetail(
    type = "payment_initiation",
    actions = listOf("initiate"),
    locations = listOf("https://example.com/payments"),
    additionalFields = mapOf(
        "instructedAmount" to mapOf("currency" to "EUR", "amount" to "123.50"),
        "creditorName" to "Merchant A",
    ),
)
```

The `type` field is required; `locations`, `actions`, `datatypes`, and `privileges` are the common optional fields defined by RFC 9396.

After creating the authorization detail, you can provide it to the Orchestration SDK during either of the following actions:

* Starting the OIDC flow

  Per-call details are the natural fit for transactions, because each payment is a new consent:

  ```kotlin
  web.authorize {
      authorizationDetails(payment)
  }
  ```

* Configuring the OIDC module

  Add an `authorizationDetails` property when [configuring the OIDC module](../../../usage/android-centralized-login.html#android_oidc_full_configuration):

  ```kotlin
  val rarLoginClient = OidcWebClient {
      module(com.pingidentity.oidc.module.Oidc) {
          discoveryEndpoint = "https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration"
          clientId = "sdkPublicClient"
          redirectUri = "org.pingidentity.demo://callback"
          par = true
          authorizationDetails = listOf(payment)
      }
  }
  ```

### Running RAR alongside an existing login

A RAR login usually happens after the user has already signed in, so the app holds two tokens: the original login token, and the token issued for the RAR transaction.

To keep both tokens and prevent them either overwriting one another, or being revoked by the Orchestration SDK, give the RAR login its own storage configuration:

Example of keeping RAR tokens in separate storage (PingOne Advanced Identity Cloud)

```kotlin
// The original sign-in (Token A)
val journeyUser = journey.user()

// The RAR transaction login (Token B), in its own storage.
// Configure the client once, at app startup:
val rarLoginClient = OidcWebClient {
    module(com.pingidentity.oidc.module.Oidc) {
        clientId = "sdkPublicClient"
        discoveryEndpoint = "https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration"
        redirectUri = "org.pingidentity.demo://callback"
        par = true

        storage {
            // A distinct file name keeps the RAR token out of the
            // storage used by the original sign-in
            fileName = "com.pingidentity.sdk.v1.rar.tokens"
            keyAlias = "com.pingidentity.sdk.v1.rar.tokens"
        }
    }
}

// For each RAR transaction, build the authorizationDetail:
val payment = AuthorizationDetail(
    type = "payment_initiation",
    actions = listOf("initiate"),
    locations = listOf("https://example.com/payments"),
    additionalFields = mapOf(
        "instructedAmount" to mapOf("currency" to "EUR", "amount" to "123.50"),
        "creditorName" to "Merchant A",
    ),
)

// Then authorize, passing the detail per call:
val rarResult = rarLoginClient.authorize {
    authorizationDetails(payment)
}
```

## Reading the granted details

The authorization server echoes the details it actually granted in the token response, and the OIDC module decodes them onto the token.

The granted set can differ from the requested set, so check it rather than assuming:

Example reading the granted `authorization_details` from the token

```kotlin
val token = web.user().token()
token.authorizationDetails?.let { granted ->
    granted.forEach { detail ->
        println("Granted type: ${"$"}{detail.type}")
    }
}
```

## Understanding the limitations

RAR is only supported by the browser-based OIDC sign-on flow, as it is the only one that displays a rich consent screen.

### Native journeys cannot carry RAR

The journey module's re-authorize request is a headless call that exchanges tokens in the background and never displays a consent page. If you send `authorization_details` on that path, the server rejects the request.

In practice this means a user who signs in with a native journey has consented to the scopes on that journey, but you cannot use that sign-in to get consent for a transaction such as a payment.

To get transaction consent for those users, run a separate browser-based OIDC authorization for the transaction, as shown in [Running RAR alongside an existing login](#rar-alongside-existing-login).

### Device authorization flows cannot initiate RAR

Device authorization is designed for input-constrained devices such as smart TVs that cannot display a rich consent page, so the server ignores `authorization_details` in the device authorization request. The SDK's device client does not send the parameter at all.

In practice this means a TV or streaming device cannot use RAR to ask the user to approve a specific transaction. If your app covers such devices, treat the transaction approval as a separate step the user completes on the consent-capable device, or scope the device's access with ordinary scopes instead.

## Next steps

* See the complete flow working: [Running a RAR flow in Android](try-it-out.html)
