# AttributeError at authorization-code/callback

**URL:** <https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199>\
**Category:** Questions\
**Created:** [January 31, 2023, 11:09am UTC](https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199 "2023-01-31T11:09:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkswcud2](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rkswcud2](https://devforum.okta.com/u/rkswcud2)\
**Post date:** [January 31, 2023, 11:09am UTC](https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199/1 "2023-01-31T11:09:46Z")

</div>

I am trying to integrate Okta Single Sing On in a Django Rest Framework web app with front-end in React. I following this [documentation](https://developer.okta.com/docs/guides/sign-into-web-app-redirect/python/main/#configure-your-app) also I am not sure if this is correct or not. But following this documentation I am able to create the authentication URL. After entering the URL I am able to authenticate the user, but after authentication and when the callback function is called I am facing this issue:

 ![image](https://global.discourse-cdn.com/oktadev/original/2X/8/80cf21cb1f31c4d7eeca8a34fe0efc2efcd6e7d4.png)  
When debugging it I found the error is related to PKCE Verification failure. But I am not sure why this is producing the error. I am sure it is about the code\_challenge but not able to figure it our how to fix it. Prior to this I have also tried using the mozilla\_django\_oidc in this I am having [this issue](https://stackoverflow.com/questions/75281258/suspiciousoperation-at-oidc-callback-mozilla-django-oidc-with-drf)

If anyone has gone through or have any idea about it, please let me know that would be awesome.  
Thanks

---

<div class="post-metadata">

**Author:** ![sigama](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/sigama/32/5811_2.png) [@sigama](https://devforum.okta.com/u/sigama)\
**Post date:** [January 31, 2023, 11:41pm UTC](https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199/2 "2023-01-31T23:41:34Z")

</div>

Hi @rkswcud2! Just to confirm, using the doc you referenced you created a web app that uses [auth code flow grant](https://developer.okta.com/docs/guides/implement-grant-type/authcode/main/) and not [auth code flow with PKCE](https://developer.okta.com/docs/guides/implement-grant-type/authcodepkce/main/) correct?

---

<div class="post-metadata">

**Author:** ![rkswcud2](https://avatars.discourse-cdn.com/v4/letter/r/a4c791/32.png) [@rkswcud2](https://devforum.okta.com/u/rkswcud2)\
**Post date:** [February 1, 2023, 6:28am UTC](https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199/3 "2023-02-01T06:28:28Z")

</div>

Thanks a ton for the reply. Well I am not sure at all. I am just following along the documentations and the flask-sample project from Okta’s github repository.

---

<div class="post-metadata">

**Author:** ![sigama](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/sigama/32/5811_2.png) [@sigama](https://devforum.okta.com/u/sigama)\
**Post date:** [February 1, 2023, 7:43pm UTC](https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199/4 "2023-02-01T19:43:31Z")

</div>

Ok so I see the samples here [GitHub - okta/samples-python-flask: samples-python-flask](https://github.com/okta/samples-python-flask) do reference a web app. Can you share a screenshot of your OIDC App setup in your Okta dashboard. You can hide your client id and secret before posting here.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 13, 2024, 7:05pm UTC](https://devforum.okta.com/t/attributeerror-at-authorization-code-callback/23199/5 "2024-02-13T19:05:58Z")

</div>

Closed on February 13, 2024, 7:05pm UTC


