<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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">
well, 5 min later I have figure it out, that I was requesting only email in authorize url, and asking for profile and email, so by adding email+profile in auth url fixed the problem !
<span id="��">��</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<span>Bart</span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Pdb-tech <pdb-tech-bounces@lists.peeringdb.com> on behalf of Bartosz Miklaszewski <bartosz@miklaszewski.com><br>
<b>Sent:</b> 26 June 2023 22:36<br>
<b>To:</b> pdb-tech@lists.peeringdb.com <pdb-tech@lists.peeringdb.com><br>
<b>Subject:</b> [PDB Tech] OAuth client application help request: cannot get user profile</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi,</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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 class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Now I am receiving token and try to request user profile, but getting Resposne 403<br>
<br>
cant figure out why,</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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 class="x_ContentPasted0" style="color:rgb(197,134,192)">from</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">django</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">shortcuts</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(197,134,192)">import</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">render</span></span>
<div><span class="x_ContentPasted0" style="color:rgb(197,134,192)">from</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">django</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">http</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(197,134,192)">import</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">HttpRequest</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">HttpResponse</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">JsonResponse</span></div>
<div><span class="x_ContentPasted0" style="color:rgb(197,134,192)">from</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">django</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">shortcuts</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(197,134,192)">import</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">redirect</span></div>
<div><span class="x_ContentPasted0" style="color:rgb(197,134,192)">import</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">requests</span></div>
<br class="x_ContentPasted0">
<div><span class="x_ContentPasted0" style="color:rgb(106,153,85)"># Create your views here.</span></div>
<div><span class="x_ContentPasted0" style="color:rgb(156,220,254)">redirect_url_peeringdb</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">'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 class="x_ContentPasted0" style="color:rgb(156,220,254)">client_id</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"<client_id>"</span></div>
<div><span class="x_ContentPasted0" style="color:rgb(156,220,254)">client_secret</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"<client_secret>"</span></div>
<br class="x_ContentPasted0">
<br class="x_ContentPasted0">
<div><span class="x_ContentPasted0" style="color:rgb(86,156,214)">def</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">home</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">request</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">HttpRequest</span><span class="x_ContentPasted0">) ->
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">JsonResponse</span><span class="x_ContentPasted0">:</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(197,134,192)">return</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">JsonResponse</span><span class="x_ContentPasted0">({
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"msg"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"Hello World"</span><span class="x_ContentPasted0"> })</span></div>
<br class="x_ContentPasted0">
<div><span class="x_ContentPasted0" style="color:rgb(86,156,214)">def</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">peeringdb_login</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">request</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">HttpRequest</span><span class="x_ContentPasted0">):</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(197,134,192)">return</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">redirect</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">redirect_url_peeringdb</span><span class="x_ContentPasted0">)</span></div>
<br class="x_ContentPasted0">
<div><span class="x_ContentPasted0" style="color:rgb(86,156,214)">def</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">peeringdb_login_redirect</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">request</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">HttpRequest</span><span class="x_ContentPasted0">):</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">code</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">request</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">GET</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">get</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">'code'</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 1  ### code: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">code</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">user</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">exchange_code</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">code</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 2  ### email: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">user</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(197,134,192)">return</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">JsonResponse</span><span class="x_ContentPasted0">({
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"user"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">user</span><span class="x_ContentPasted0">})</span></div>
<br class="x_ContentPasted0">
<div><span class="x_ContentPasted0" style="color:rgb(86,156,214)">def</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">exchange_code</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">code</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">str</span><span class="x_ContentPasted0">):</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 3  ### code: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">code</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">data</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> {</span></div>
<div><span class="x_ContentPasted0">      </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"client_id"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"<client_id>"</span><span class="x_ContentPasted0">,</span></div>
<div><span class="x_ContentPasted0">      </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"client_secret"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"<client_secret>"</span><span class="x_ContentPasted0">,</span></div>
<div><span class="x_ContentPasted0">      </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"grant_type"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"authorization_code"</span><span class="x_ContentPasted0">,</span></div>
<div><span class="x_ContentPasted0">      </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"code"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">code</span><span class="x_ContentPasted0">,</span></div>
<div><span class="x_ContentPasted0">      </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"redirect_uri"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"https://localhost:8000/oauth2/login/redirect"</span><span class="x_ContentPasted0">,</span></div>
<div><span class="x_ContentPasted0">      </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"scope"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"email"</span></div>
<div><span class="x_ContentPasted0">    }</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">headers</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> {</span></div>
<div><span class="x_ContentPasted0">        </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">'Content-Type'</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">'application/x-www-form-urlencoded'</span><span class="x_ContentPasted0"> </span></div>
<div><span class="x_ContentPasted0">    }</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">requests</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">post</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"https://auth.peeringdb.com/oauth2/token/"</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">data</span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">data</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">headers</span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">headers</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 4  ### response: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 5  ### response.json: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">json</span><span class="x_ContentPasted0">())</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">credentials</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">json</span><span class="x_ContentPasted0">()</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 6  ### credentials: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">credentials</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">access_token</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">credentials</span><span class="x_ContentPasted0">[</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">'access_token'</span><span class="x_ContentPasted0">]</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 7  ### access_token: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">access_token</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response1</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(78,201,176)">requests</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">get</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"https://auth.peeringdb.com/profile/v1"</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">headers</span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0">{</span></div>
<div><span class="x_ContentPasted0">        </span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"Authorization"</span><span class="x_ContentPasted0">:
</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"Bearer </span>
<span class="x_ContentPasted0" style="color:rgb(86,156,214)">%s</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">%</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">access_token</span></div>
<div><span class="x_ContentPasted0">    })</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 8  ### response1: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response1</span><span class="x_ContentPasted0">)</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 9  ### response1: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response1</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">json</span><span class="x_ContentPasted0">())</span></div>
<div><span class="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">user</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(212,212,212)">=</span><span class="x_ContentPasted0"> </span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">response1</span><span class="x_ContentPasted0">.</span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">json</span><span class="x_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="x_ContentPasted0">    </span><span class="x_ContentPasted0" style="color:rgb(220,220,170)">print</span><span class="x_ContentPasted0">(</span><span class="x_ContentPasted0" style="color:rgb(206,145,120)">"### 10 ### user: "</span><span class="x_ContentPasted0">,
</span><span class="x_ContentPasted0" style="color:rgb(156,220,254)">user</span><span class="x_ContentPasted0">)</span></span></div>
<br>
</div>
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof x_ContentPasted1" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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="x_ContentPasted1">### 1  ### code:  <code></div>
<div class="x_ContentPasted1">### 3  ### code:  <span class="x_ContentPasted2" style="display:inline!important; color:rgb(0,0,0); background-color:rgb(255,255,255)"><code></span></div>
<div class="x_ContentPasted1">### 4  ### response:  <Response [200]></div>
<div class="x_ContentPasted1">### 5  ### response.json:  {'access_token': '<access_token>', 'expires_in': 36000, 'token_type': 'Bearer', 'scope': 'email', 'refresh_token': '<refresh_token>'}</div>
<div class="x_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="x_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="x_ContentPasted1">### 8  ### response1:  <Response [403]></div>
<div class="x_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="x_ContentPasted1">Traceback (most recent call last):</div>
<div class="x_ContentPasted1">  File "/Users/miklab01/Library/Python/3.9/lib/python/site-packages/requests/models.py", line 971, in json</div>
<div class="x_ContentPasted1">    return complexjson.loads(self.text, **kwargs)</div>
<div class="x_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="x_ContentPasted1">    return _default_decoder.decode(s)</div>
<div class="x_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="x_ContentPasted1">    obj, end = self.raw_decode(s, idx=_w(s, 0).end())</div>
<div class="x_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="x_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 class="x_ContentPasted3" style="color:rgb(206,145,120)">https://auth.peeringdb.com/profile/v1/ </span></span></div>
</div>
</div>
</body>
</html>