---
title: Trying out RAR for JavaScript
description: "Run a complete Rich Authorization Requests (RAR) payment transaction in a JavaScript app: hosting the sample Remote Consent Service, preparing PingOne Advanced Identity Cloud or PingAM, and updating your own app."
component: orchsdks
page_id: orchsdks:oidc:use-cases/rar/javascript/try-it-out
canonical_url: https://developer.pingidentity.com/orchsdks/oidc/use-cases/rar/javascript/try-it-out.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, 18 Nov 2026 00:00:00 +0000
keywords: ["OAuth 2.0", "OpenID Connect", "Rich Authorization Requests", "RAR", "RFC 9396", "authorization_details", "JavaScript", "SDK"]
section_ids:
  before_you_begin: Before you begin
  step_1_host_the_remote_consent_service: Step 1. Host the Remote Consent Service
  step_2_prepare_the_authorization_server: Step 2. Prepare the authorization server
  step_3_run_the_flow_in_your_app: Step 3. Run the flow in your app
---

# Trying out RAR for JavaScript

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

In this walkthrough you run a complete RAR payment transaction in a JavaScript web app: the app requests authorization for a specific payment, you approve the payment details on the Remote Consent Service page, and the app receives the granted details back in its tokens.

## Before you begin

Ensure that you have completed the following prerequisite tasks before attempting to run the walkthrough:

* [Step 1. Hosting a Remote Consent Service](../01-setup-rcs.html)

* [Step 2. Preparing the authorization server](../02-setup-server.html)

  The walkthrough supports both PingOne Advanced Identity Cloud and PingAM.

## Step 1. Host the Remote Consent Service

The consent page that shows the user the payment details is a Remote Consent Service (RCS): a small web application that you host.

The authorization server sends it the requested `authorization_details` in a signed JWT, the RCS renders those details for you, and it returns a signed JWT with your decision.

In this step you'll run a demonstration RCS and expose it over HTTPS, so you can try the complete flow without building your own consent UI.

[**Start step 1**[icon: chevrons-right, set=fas, size=xs]](../01-setup-rcs.html)

## Step 2. Prepare the authorization server

With the RCS running, your authorization server needs to know about it.

You'll enable RAR processing on the OAuth2 provider, create a Remote Consent Agent pointing at your RCS, and configure an OAuth 2.0 client with the authorization detail types it may request.

|   |                                                                                                      |
| - | ---------------------------------------------------------------------------------------------------- |
|   | The steps are the same on PingOne Advanced Identity Cloud and PingAM; only the console paths differ. |

[**Start step 2**[icon: chevrons-right, set=fas, size=xs]](../02-setup-server.html)

## Step 3. Run the flow in your app

In this step you run the complete RAR payment transaction in your own JavaScript app.

1. [Add RAR support to your app](usage.html), requesting the payment authorization details your client is configured to accept.

2. Start the OAuth 2.0 flow with `authorize.url()` or `authorize.background()`.

   The browser opens, you sign in, and the authorization server redirects to the RCS consent page.

3. Review the payment details on the consent page, and approve them.

   The RCS returns its signed consent response, and the authorization server redirects back to your app with an authorization code.

4. Exchange the code for tokens, and read the granted `authorization_details` from the token response.

   Check that the granted details match the payment you approved: type `payment_initiation`, the instructed amount, and the creditor.

**Troubleshooting the result**

|                                                         |                                                                                                                                                                                        |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| What you see                                            | What it means                                                                                                                                                                          |
| Granted `authorization_details` is an empty array `[]`  | RAR processing ran, but the consent response carried no details. Either the RCS has no enricher for the requested type and dropped it, or the consent response did not echo the claim. |
| No `authorization_details` in the token response at all | RAR processing never ran. Check the Rich Authorization Requests with Remote Consent Service provider toggle, and the tenant version on PingOne Advanced Identity Cloud.                |
| `invalid_authorization_details` at the authorize step   | The requested type is not in the client's Authorization Detail Type(s) list.                                                                                                           |
| `invalid_request` at the authorize step                 | The client has implied consent enabled, which is incompatible with RAR. Turn implied consent off.                                                                                      |
| Consent page fails with a JWT signature error           | The Remote Consent Agent's signing algorithm does not match the RCS. With the demonstration RCS, set the agent to HS256.                                                               |
| "Unexpected number of Base64URL parts, must be three"   | Consent request encryption is enabled on the agent. Turn it off; the demonstration RCS reads signed, not encrypted, JWTs.                                                              |
