> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.beaglesecurity.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Setting up PKCE authorization for sequence record

This guide walks you through configuring OAuth 2.0 PKCE authorization, generating an access token, and recording an authenticated test sequence using the Beagle Sequence Recorder extension. 

# Overview 
The process has three main stages: 

* **Configure PKCE authorization** for your API in Beagle Security.

* **Generate a personal access token** and connect it to the Sequence Recorder .

* **Record,** **finalize, and** **submit** your authenticated sequence 

# Stage 1: Configure PKCE authorization 
* From the **Applications** list, select the relevant API. 

* Click the **API configuration** button. 

* PKCE authorization can be set up under any of the following:  
    1. **Shared resources**
    2. **Default auth**
    3. **Role based auth**

* Under **Shared resources → Shared** **authorizations**, click **Add** **authorization**.  
    1. Enter an **Authorization name.** 
    2. Set **Type** to **OAuth 2.0.**

* Configure the authorization data:  
    1. **Add authorization data to:** Request headers
    2. **Grant type:** Authorization code (with PKCE)

* Set **Authentication provider** to **Custom**.

* Set **Header prefix** to **Bearer**. 

* Provide details such as:  
    1. Callback URL
    2. Auth URL
    3. Access token URL
    4. Client ID

* If you require Code challenge, set **Code** **challenge** **method** to **SHA-256**, and provide the required **Scope**. 

* Provide:  
    1. Client authentication method.
    2. Username and password of your account.

* Click **Save**.  

||| The authorization must be saved before it can be tested. 

# Stage 2: Test authorization & generate access token 
* Go to the **Shared** **authorizations** list, select your saved authorization, and click **Test** at the bottom of the side panel. 

* Generate the **personal access token**. 
# Stage 3: Connect the Sequence Recorder 
* Open the **Beagle Sequence Recorder** browser extension. 

* Select **Login PKCE**. 

* Enter both the tokens in their corresponding input fields:
    * **Personal access token**
    * **PKCE recorder access token**

* Click **Continue**. You can now begin recording your sequence on the target website. 

# Stage 4: Record the sequence 
* **Recommended:** log out of the website before recording if you intend to replay the recording later. 

* The recorded sequence will play back in a new browser tab. 

* To make changes: 
    * Click **Reset** and redo the recording as needed.
    * Once finalized, click **Submit.**

* Provide the necessary recording details, then click **Submit to Beagle**. 

# Stage 5: Retrieve the result token 
* Return to the **Beagle Security** tab and click **Refresh** at the bottom of the side panel. 

* If the recording was successful, a token will be generated. Click **Get token** to view the result token. 

| Note: Every time the user initiates a test based on this setup, Beagle Security's test engine will automatically use this recording and token to test the sequence.  

| Action | Outcome |
| ---- |
| **Re-record** in side panel | Creates a new recording. Deletes the previous recording and its result token. |
| **Update tokens** in Beagle Sequence Recorder | Use this in the Sequence Recorder if switching to a different account to create another recording. |


