<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CCP with Client Cert Auth from Linux in PAM Self-Hosted Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351651#M43277</link>
    <description>&lt;P&gt;I have a client need to call the CCP load balanced URL from a Linux server using certificate based authentication. I have the working Posh example from Windows, but wondering if anyone has gotten this to work from Linux.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 15:37:45 GMT</pubDate>
    <dc:creator>rvipp</dc:creator>
    <dc:date>2024-12-11T15:37:45Z</dc:date>
    <item>
      <title>CCP with Client Cert Auth from Linux</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351651#M43277</link>
      <description>&lt;P&gt;I have a client need to call the CCP load balanced URL from a Linux server using certificate based authentication. I have the working Posh example from Windows, but wondering if anyone has gotten this to work from Linux.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 15:37:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351651#M43277</guid>
      <dc:creator>rvipp</dc:creator>
      <dc:date>2024-12-11T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: CCP with Client Cert Auth from Linux</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351652#M43278</link>
      <description>&lt;CODE&gt;#!/bin/bash
 
# Variables
URL="AAMServer.company.com"
AIMWEB="AIMWebService"
SAFE="SafeName"
APPID="APPIDName"
ACCOUNTOBJECTNAME="OBJECTID_NAME"
Reason="REASONFORPASSWORDPULL"
 
# Client certificate and key (update these paths as necessary)
CLIENT_CERT="./client.pem"
CLIENT_KEY="./privkey.pem"
 
# Headers
headers=("Content-Type: application/json")
 
# Function to make the API request
function get_account_info {
    # Create a temporary unencrypted key
    TEMP_KEY=$(mktemp)
    openssl rsa -in "$CLIENT_KEY" -out "$TEMP_KEY"
 
    response=$(curl -k --insecure -s -G "https://$URL/$AIMWEB/api/Accounts" \
        --data-urlencode "AppID=$APPID" \
        --data-urlencode "Safe=$SAFE" \
        --data-urlencode "Object=$ACCOUNTOBJECTNAME" \
        --data-urlencode "Reason=$Reason" \
        -H "${headers[@]}" \
        --cert "$CLIENT_CERT" \
        --key "$TEMP_KEY")
 
    # Clean up the temporary key
    rm -f "$TEMP_KEY"
 
    echo "$response"
}
 
# Initial API call
response=$(get_account_info)
 
echo $response
 
# Check if password change is in process
password_change=$(echo "$response" | grep -o '"PasswordChangeInProcess": *"[^"]*"' | awk -F: '{print $2}' | tr -d ' "')
 
# Extract Username and Password
UserName=$(echo "$response" | grep -o '"UserName": *"[^"]*"' | awk -F: '{print $2}' | tr -d ' "')
Password=$(echo "$response" | grep -o '"Content": *"[^"]*"' | awk -F: '{print $2}' | tr -d ' "')
 
# Output results (optional)
echo "Username: $UserName"
echo "Password: $Password"&lt;/CODE&gt;&lt;P&gt;This should work for you&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:21:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351652#M43278</guid>
      <dc:creator>Trevor_B</dc:creator>
      <dc:date>2024-12-11T17:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: CCP with Client Cert Auth from Linux</title>
      <link>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351653#M43279</link>
      <description>&lt;P&gt;This is wonderful! Much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:26:18 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/pam-self-hosted-discussions/ccp-with-client-cert-auth-from-linux/m-p/1351653#M43279</guid>
      <dc:creator>rvipp</dc:creator>
      <dc:date>2024-12-11T17:26:18Z</dc:date>
    </item>
  </channel>
</rss>

