Flask Tutorial: Simple User Registration and Login

Flask Tutorial: Simple User Registration and Login

This post walks you through building a simple Flask web app with user registration and login.

Matthew Jennings

getting error 404 so redirect isn’t working as expected. Any advice on how to troubleshoot?

Randall Degges

Hey! Sorry for the delay here, am behind on email. Where are you getting the 404 from? From Okta? If so, please check your URIs are correct, it’s easy to mistype the endpoints.

Shawn Green

I too am receiving the error 404 redirect. I double checked my configured URIs and they appear correct (see attachment). Snippet of the generated URL from the local Flask application:
http://localhost:5000{{https://dev-xxxxxx.oktaprev…}}/oauth2/… https://uploads.disquscdn.c…

Abhinav Jonnada

Hey guys I really enjoy the article. When I run it and try accessing the login/register page. I end up getting a error 404 page or the page doesn’t exist. Here’s a link to my GitHub page: https://github.com/abhinavj…
Please could someone help me out!!

Abhinav Jonnada

I’ve been getting the same error 404. And I’ve checked my URI and endpoints as well. I still get the same issue.

Randall Degges

Hey! I took a look at the code you posted on your GitHub but there are a bunch of Python errors and I can’t actually run the server. Once you fix those can you link me to the updated source so I can take a look? The example here still runs fine for me when I go through it.

Abhinav Jonnada

Hey ! i followed flask tutorial simple user registration. I basically copied what you wrote. I still get the same error when I access Login/Registration page. Link:

https://github.com/abhinavj…

Appreciate it for the help!!

Lawrence Toole

Did you ever get your issue resolved? I’m getting a 400 error back from OKTA and the following The ‘redirect_uri’ parameter must be an absolute URI that is whitelisted in the client app settings

Lawrence Toole

Were you able to resolve your 404 error. I’m getting a 400 error back from OTKA with the following error message… The ‘redirect_uri’ parameter must be an absolute URI that is whitelisted in the client app settings. My code looks good compared to the example.

Abhinav Jonnada

Nah I wasn’t able to solve my error!! :frowning:

Nick

This tutorial doesn’t work!
400 ERROR.

TrickiDicki

In the Okta ‘applications’ settings, try adding another 'Login redirect URI’

http://localhost:5000/oidc/callback

Nick

Thanks for your answer.
Of course I tried this address from tutorial
http://localhost:5000/oidc/callback

Lucid-Network same answer doesn’t helps
https://github.com/rdegges/…

I also tried to add this line to
"redirect_uris" in client_secrets.json

Doesn’t work.

TrickiDicki

If I click ‘Log out’ and then ‘Log in’ again, I am not asked for my username & password again and I’m logged straight in.
How can I ensure that the user is fully logged out and will be required to enter username/pwd when they log in the second time?

Balaji Dommaraju

Hi @TrickiDicki
May I know how to pass the proxy information to access token and other URLS

Randall Degges

This is because the OIDC authorization server has a server-side session cookie set that maintains your session. In this example app, when you log out, your local token is destroyed. But your server side session still exists.

You can manually revoke your token on the sever using the Okta APIs if you’d like to “fully” log a user out.

Randall Degges

Hey there. I just ran through this on a fresh laptop instance, but everything is working. Can you provide some more info? I suggest double checking all the values you’re supplying to make sure things are good!

Randall Degges

Hey! I just tested this out with a fresh install on my laptop, and by running through the tutorial and following the directions exactly I’m able to get it working no problem. Can you please make sure you’re supplying all the necessary fields?

Giuseppe Salvatore

Hi,
in my organisation I was using a set of Jenkins job to connect to Jira and other services information through python scripts and everything was working fine. Now my org ha switched to Okta and obviously everything is failing. I was searching for a way to do authentication (I mean login) into Okta programmatically with python. I understand there is a no longer maintained repo with a solution but I was actually hoping for some official Okta API, is that available anywhere?
Thanks