---
title: Specifying a dynamic authorization header for a REST API datastore
description: When you configure an authentication source with an application, you can use the access token from the connection as a bearer token in an authorization header to receive additional information as needed.
component: pingfederate
version: 13.1
page_id: pingfederate:administrators_reference_guide:pf_specify_dynamic_auth_header_for_a_rest_api_datastore
canonical_url: https://docs.pingidentity.com/pingfederate/13.1/administrators_reference_guide/pf_specify_dynamic_auth_header_for_a_rest_api_datastore.html
llms_txt: https://docs.pingidentity.com/pingfederate/llms.txt
docs_for_agents: https://developer.pingidentity.com/build-with-ai/docs-for-agents.md
revdate: June 18, 2025
section_ids:
  about-this-task: About this task
  before-you-begin: Before you begin
  steps: Steps
  example: Example
  authorization-headers: Authorization headers
---

# Specifying a dynamic authorization header for a REST API datastore

When you configure an authentication source with an application, you can use the access token from the connection as a bearer token in an authorization header to receive additional information as needed.

## About this task

The access token used in the authorization header can originate from various upstream sources within the PingFederate policy, such as identity provider (IdP) *(tooltip: \<div class="paragraph">
\<p>A service that manages identity information and provides authentication services to relying clients or SPs within a federated or distributed network.\</p>
\</div>)* adapters that generate and retrieve access tokens or connections to external IdPs that provide access tokens upon successful authentication.

## Before you begin

* Create a service provider (SP) *(tooltip: \<div class="paragraph">
  \<p>In SAML, an entity that receives and accepts an authentication assertion issued by an IdP, typically for the purpose of allowing access to a protected resource.\</p>
  \</div>)* or IdP connection.

* Configure an IdP authentication policy for the connection.

## Steps

1. Get the access token that you plan to use as a bearer token.

   After you've made the connection, you can find the access token attribute name in `<pf_install>/pingfederate/log/server.log` in debug mode.

   |   |                                                                                       |
   | - | ------------------------------------------------------------------------------------- |
   |   | The access token name is generated based on your specific PingFederate configuration. |

2. On the **Configure Data Source Filters** page, in the **Authorization Header** field, enter the access token attribute name.

   |   |                                                                                                                                                                                                                                                |
   | - | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |   | You can reference attribute values in the form of `${attributeName:-defaultValue}`. The default value is optional. When specified, it is used at runtime if the attribute value isn't available. Do not use `${` and `}` in the default value. |

## Example

### Authorization headers

Sample **Authorization Header** entries are shown here:

* For a Yahoo OpenID Connect Connection: `Bearer $\{idp.https://api.login.yahoo.com.access_token}`

* For a Google OpenID Connect Connection: `Bearer $\{idp.https://accounts.google.com.access_token}`

* For an adapter: `Bearer ${adapter.myadapterid.token}`
