<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I am struggling with this for a while, maybe someone would be abloe to help.<br>
<br>
In short, i try use flask with oauth but failed on getting token back, moved to django, and I was able to pass token.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Now I am receiving token and try to request user profile, but getting Resposne 403<br>
<br>
cant figure out why,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
My code:<br>
<br>
<div style="font-family: Menlo, Monaco, "Courier New", monospace; font-weight: normal; font-size: 14px; line-height: 21px; color: rgb(204, 204, 204); background-color: rgb(31, 31, 31);">
<span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">from</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">django</span><span class="ContentPasted0">.</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">shortcuts</span><span class="ContentPasted0"> </span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">import</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">render</span></span>
<div><span style="color: rgb(197, 134, 192);" class="ContentPasted0">from</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">django</span><span class="ContentPasted0">.</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">http</span><span class="ContentPasted0"> </span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">import</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">HttpRequest</span><span class="ContentPasted0">,
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">HttpResponse</span><span class="ContentPasted0">,
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">JsonResponse</span></div>
<div><span style="color: rgb(197, 134, 192);" class="ContentPasted0">from</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">django</span><span class="ContentPasted0">.</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">shortcuts</span><span class="ContentPasted0"> </span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">import</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">redirect</span></div>
<div><span style="color: rgb(197, 134, 192);" class="ContentPasted0">import</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">requests</span></div>
<br class="ContentPasted0">
<div><span style="color: rgb(106, 153, 85);" class="ContentPasted0"># Create your views here.</span></div>
<div><span style="color: rgb(156, 220, 254);" class="ContentPasted0">redirect_url_peeringdb</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">'https://auth.peeringdb.com/oauth2/authorize/auth?response_type=code&client_id=<client_id>&redirect_uri=https://localhost:8000/oauth2/login/redirect&scope=email&state=1234zyx'</span></div>
<div><span style="color: rgb(156, 220, 254);" class="ContentPasted0">client_id</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"<client_id>"</span></div>
<div><span style="color: rgb(156, 220, 254);" class="ContentPasted0">client_secret</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"<client_secret>"</span></div>
<br class="ContentPasted0">
<br class="ContentPasted0">
<div><span style="color: rgb(86, 156, 214);" class="ContentPasted0">def</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">home</span><span class="ContentPasted0">(</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">request</span><span class="ContentPasted0">:
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">HttpRequest</span><span class="ContentPasted0">) ->
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">JsonResponse</span><span class="ContentPasted0">:</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">return</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">JsonResponse</span><span class="ContentPasted0">({
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"msg"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"Hello World"</span><span class="ContentPasted0"> })</span></div>
<br class="ContentPasted0">
<div><span style="color: rgb(86, 156, 214);" class="ContentPasted0">def</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">peeringdb_login</span><span class="ContentPasted0">(</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">request</span><span class="ContentPasted0">:
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">HttpRequest</span><span class="ContentPasted0">):</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">return</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">redirect</span><span class="ContentPasted0">(</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">redirect_url_peeringdb</span><span class="ContentPasted0">)</span></div>
<br class="ContentPasted0">
<div><span style="color: rgb(86, 156, 214);" class="ContentPasted0">def</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">peeringdb_login_redirect</span><span class="ContentPasted0">(</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">request</span><span class="ContentPasted0">:
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">HttpRequest</span><span class="ContentPasted0">):</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">code</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">request</span><span class="ContentPasted0">.</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">GET</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">get</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">'code'</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 1  ### code: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">code</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">user</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">exchange_code</span><span class="ContentPasted0">(</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">code</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 2  ### email: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">user</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(197, 134, 192);" class="ContentPasted0">return</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">JsonResponse</span><span class="ContentPasted0">({
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"user"</span><span class="ContentPasted0">:
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">user</span><span class="ContentPasted0">})</span></div>
<br class="ContentPasted0">
<div><span style="color: rgb(86, 156, 214);" class="ContentPasted0">def</span><span class="ContentPasted0"> </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">exchange_code</span><span class="ContentPasted0">(</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">code</span><span class="ContentPasted0">:
</span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">str</span><span class="ContentPasted0">):</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 3  ### code: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">code</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">data</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> {</span></div>
<div><span class="ContentPasted0">      </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"client_id"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"<client_id>"</span><span class="ContentPasted0">,</span></div>
<div><span class="ContentPasted0">      </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"client_secret"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"<client_secret>"</span><span class="ContentPasted0">,</span></div>
<div><span class="ContentPasted0">      </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"grant_type"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"authorization_code"</span><span class="ContentPasted0">,</span></div>
<div><span class="ContentPasted0">      </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"code"</span><span class="ContentPasted0">:
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">code</span><span class="ContentPasted0">,</span></div>
<div><span class="ContentPasted0">      </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"redirect_uri"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"https://localhost:8000/oauth2/login/redirect"</span><span class="ContentPasted0">,</span></div>
<div><span class="ContentPasted0">      </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"scope"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"email"</span></div>
<div><span class="ContentPasted0">    }</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">headers</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> {</span></div>
<div><span class="ContentPasted0">        </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">'Content-Type'</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">'application/x-www-form-urlencoded'</span><span class="ContentPasted0"> </span></div>
<div><span class="ContentPasted0">    }</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">requests</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">post</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"https://auth.peeringdb.com/oauth2/token/"</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">data</span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">data</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">headers</span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">headers</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 4  ### response: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 5  ### response.json: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">json</span><span class="ContentPasted0">())</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">credentials</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">json</span><span class="ContentPasted0">()</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 6  ### credentials: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">credentials</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">access_token</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">credentials</span><span class="ContentPasted0">[</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">'access_token'</span><span class="ContentPasted0">]</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 7  ### access_token: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">access_token</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response1</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(78, 201, 176);" class="ContentPasted0">requests</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">get</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"https://auth.peeringdb.com/profile/v1"</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">headers</span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0">{</span></div>
<div><span class="ContentPasted0">        </span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"Authorization"</span><span class="ContentPasted0">:
</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"Bearer </span>
<span style="color: rgb(86, 156, 214);" class="ContentPasted0">%s</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">%</span><span class="ContentPasted0"> </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">access_token</span></div>
<div><span class="ContentPasted0">    })</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 8  ### response1: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response1</span><span class="ContentPasted0">)</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 9  ### response1: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response1</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">json</span><span class="ContentPasted0">())</span></div>
<div><span class="ContentPasted0">    </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">user</span><span class="ContentPasted0"> </span><span style="color: rgb(212, 212, 212);" class="ContentPasted0">=</span><span class="ContentPasted0"> </span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">response1</span><span class="ContentPasted0">.</span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">json</span><span class="ContentPasted0">()</span></div>
</div>
<div style="font-family: Menlo, Monaco, "Courier New", monospace; font-weight: normal; font-size: 14px; line-height: 21px; color: rgb(204, 204, 204); background-color: rgb(31, 31, 31);">
<span><span class="ContentPasted0">    </span><span style="color: rgb(220, 220, 170);" class="ContentPasted0">print</span><span class="ContentPasted0">(</span><span style="color: rgb(206, 145, 120);" class="ContentPasted0">"### 10 ### user: "</span><span class="ContentPasted0">,
</span><span style="color: rgb(156, 220, 254);" class="ContentPasted0">user</span><span class="ContentPasted0">)</span></span></div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted1">
i am getting error:<br>
<br>
127.0.0.1 - - [26/Jun/2023 21:21:16] "GET /oauth2/login HTTP/1.1" 302 -
<div class="ContentPasted1">### 1  ### code:  <code></div>
<div class="ContentPasted1">### 3  ### code:  <span style="display: inline !important; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="ContentPasted2"><code></span></div>
<div class="ContentPasted1">### 4  ### response:  <Response [200]></div>
<div class="ContentPasted1">### 5  ### response.json:  {'access_token': '<access_token>', 'expires_in': 36000, 'token_type': 'Bearer', 'scope': 'email', 'refresh_token': '<refresh_token>'}</div>
<div class="ContentPasted1">### 6  ### credentials:  {'access_token': '<span style="display: inline !important; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><access_token></span>', 'expires_in': 36000, 'token_type': 'Bearer', 'scope': 'email',
 'refresh_token': '<refresh_token>'}</div>
<div class="ContentPasted1">### 7  ### access_token:  <span style="display: inline !important; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);"><access_token></span></div>
<div class="ContentPasted1">### 8  ### response1:  <Response [403]></div>
<div class="ContentPasted1">127.0.0.1 - - [26/Jun/2023 21:21:17] "GET /oauth2/login/redirect?code=<code>&state=1234zyx HTTP/1.1" 500 -</div>
<div class="ContentPasted1">Traceback (most recent call last):</div>
<div class="ContentPasted1">  File "/Users/miklab01/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 971, in json</div>
<div class="ContentPasted1">    return complexjson.loads(self.text, **kwargs)</div>
<div class="ContentPasted1">  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads</div>
<div class="ContentPasted1">    return _default_decoder.decode(s)</div>
<div class="ContentPasted1">  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode</div>
<div class="ContentPasted1">    obj, end = self.raw_decode(s, idx=_w(s, 0).end())</div>
<div class="ContentPasted1">  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode</div>
<div class="ContentPasted1">    raise JSONDecodeError("Expecting value", s, err.value) from None</div>
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)<br>
<br>
any one have idea where i am missing something?<br>
<br>
i think issue might be with  the url i send and autorization... ?
<div style="font-family: Menlo, Monaco, "Courier New", monospace; font-weight: normal; font-size: 14px; line-height: 21px; color: rgb(204, 204, 204); background-color: rgb(31, 31, 31);">
<span><span style="color: rgb(206, 145, 120);" class="ContentPasted3">https://auth.peeringdb.com/profile/v1/ </span></span></div>
</div>
</body>
</html>