---
title: Integrating RAR into an iOS app
description: Add Rich Authorization Requests (RAR) `authorization_details` to the PingOidc module in an iOS app, and read the granted details from the token response.
component: orchsdks
page_id: orchsdks:oidc:use-cases/rar/ios/usage
canonical_url: https://developer.pingidentity.com/orchsdks/oidc/use-cases/rar/ios/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", "iOS", "Swift", "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 iOS app

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

The Orchestration SDK for iOS provides typed support for [Rich Authorization Requests (RAR, RFC 9396)](https://datatracker.ietf.org/doc/html/rfc9396) by using the **PingOidc** 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

```swift
let payment = AuthorizationDetail(
    type: "payment_initiation",
    locations: ["https://example.com/payments"],
    actions: ["initiate"],
    additionalFields: [
        "instructedAmount": .object(["currency": .string("EUR"), "amount": .string("123.50")]),
        "creditorName": .string("Merchant A")
    ]
)
```

The `type` field is required; `locations`, `actions`, `datatypes`, and `privileges` are the common optional fields defined by RFC 9396, and are modeled as initializer parameters. Pass the type-specific fields, such as `instructedAmount`, in `additionalFields`.

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:

  ```swift
  let result = try await web.authorize { options in
      options.authorizationDetails = [payment]
  }
  ```

* Configuring the PingOidc module

  Add an `authorizationDetails` property when [configuring the PingOidc module](../../../usage/ios-centralized-login.html#ios_oidc_full_configuration):

  ```swift
  rarLoginClient = OidcWebClient.createOidcWebClient { config in
      config.module(PingOidc.OidcModule.config) { oidcValue in
          oidcValue.discoveryEndpoint = "https://openam-forgerock-sdks.forgeblocks.com/am/oauth2/realms/alpha/.well-known/openid-configuration"
          oidcValue.clientId = "sdkPublicClient"
          oidcValue.redirectUri = "org.pingidentity.demo://callback"
          oidcValue.par = true
          oidcValue.authorizationDetails = [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)

```swift
// The original sign-in (Token A)
let journeyUser = await journey.journeyUser()

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

        // A distinct keychain account keeps the RAR token out of the
        // storage used by the original sign-in
        oidcValue.storage = KeychainStorage<Token>(
            account: "RAR_ACCESS_TOKEN_STORAGE",
            encryptor: SecuredKeyEncryptor() ?? NoEncryptor()
        )
    }
}

// For each RAR transaction, build the authorizationDetail:
let payment = AuthorizationDetail(
    type: "payment_initiation",
    locations: ["https://example.com/payments"],
    actions: ["initiate"],
    additionalFields: [
        "instructedAmount": .object(["currency": .string("EUR"), "amount": .string("123.50")]),
        "creditorName": .string("Merchant A")
    ]
)

// Then authorize, passing the detail per call:
let rarResult = try await rarLoginClient.authorize { options in
    options.authorizationDetails = [payment]
}
```

## Reading the granted details

The authorization server echoes the details it actually granted in the token response, and the PingOidc 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

```swift
if case .success(let token) = await user.token() {
    token.authorizationDetails?.forEach { detail in
        print("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 agent'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 iOS](try-it-out.html)
