# Okta integration with Django

**URL:** <https://forum.djangoproject.com/t/okta-integration-with-django/11094>\
**Category:** Using Django\
**Created:** [December 18, 2021, 5:54pm UTC](https://forum.djangoproject.com/t/okta-integration-with-django/11094 "2021-12-18T17:54:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![saurabh3060](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/saurabh3060/32/6737_2.png) [@saurabh3060](https://forum.djangoproject.com/u/saurabh3060)\
**Post date:** [December 18, 2021, 5:54pm UTC](https://forum.djangoproject.com/t/okta-integration-with-django/11094/1 "2021-12-18T17:54:23Z")

</div>

Did integrate Django with okta and it is correctly authenticating. I can see in okta logs in admin panel. but request is not going to my Django app after successfully login.  
Request comes back to login page. would be greatful for kind help.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 19, 2021, 12:41am UTC](https://forum.djangoproject.com/t/okta-integration-with-django/11094/2 "2021-12-19T00:41:01Z")

</div>

Going to need a lot more specific details. Will likely need to at least see the relevent views, urls, and settings.

---

<div class="post-metadata">

**Author:** ![saurabh3060](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/saurabh3060/32/6737_2.png) [@saurabh3060](https://forum.djangoproject.com/u/saurabh3060)\
**Post date:** [December 19, 2021, 1:48am UTC](https://forum.djangoproject.com/t/okta-integration-with-django/11094/4 "2021-12-19T01:48:21Z")

</div>

Below are okta config sent for authentication.

OKTA\_AUTH = {  
“ORG\_URL”: “[dev.okta.com/](http://dev.okta.com/)”,  
“ISSUER”: “[dev.okta.com/oauth2/default](http://dev.okta.com/oauth2/default)”,  
“CLIENT\_ID”: “clientid”,  
“CLIENT\_SECRET”: “client secret”,  
“SCOPES”: “openid profile email offline\_access”, # this is the default and can be omitted  
“REDIRECT\_URI”: “127.0.0.1:8000/authorization-code/callback”,  
“LOGIN\_REDIRECT\_URL”: “127.0.0.1:8000/test”, # default  
“CACHE\_PREFIX”: “okta”, # default  
“CACHE\_ALIAS”: “default”, # default  
“PUBLIC\_NAMED\_URLS”: (), # default  
“PUBLIC\_URLS”: (), # default  
“USE\_USERNAME”: False, # default  
}

What it does is, it authenticates the request for okta oidc and should redirects login to my application "127.0.0.1:8000/test

I had to remove http and https ahead of every request as django community was not allowing me to put more than 2 urls

Redirect uri is a callback route of okta. Can you please help? Thanks

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 19, 2021, 2:09am UTC](https://forum.djangoproject.com/t/okta-integration-with-django/11094/5 "2021-12-19T02:09:48Z")

</div>

When posting code here, you can enclose it between lines of three backtick - ` characters. That means you’ll have a line of ```, then the code, then another line of ```. This will maintain the formatting of the code and prevent interpretation of things like `https://...`
