Flask OIDC HTTPS

Hi everyone, I am using a Flask app with Okta for authentication. Runs on AWS with Gunicorn3 and reverse proxy (Nginx) Everything works GREAT with http but when I install a cert (LetEncrypt) the app still works but I get a 400 error when I login. The URL that is sent to dev-xxxxx.okta.com says the callback is ‘http’ not ‘https’.
What do I need to do to get flask oidc to work with https? the OIDC config is:

app = Flask(name)
app.config[“OIDC_CLIENT_SECRETS”] = “client_secrets.json”
app.config[“OIDC_COOKIE_SECURE”] = False
app.config[“OIDC_CALLBACK_ROUTE”] = “/oidc/callback”
app.config[“OIDC_SCOPES”] = [“openid”, “email”, “profile”]
app.config[‘SECRET_KEY’] = ‘super secet’
app.config[“OIDC_ID_TOKEN_COOKIE_NAME”] = “oidc_token”
oidc = OpenIDConnect(app)
okta_client = UsersClient(“https://dev-xxxxxx.okta.com”, “AUTH TOKEN”)

if name == ‘main’:
app.run(ssl_context=‘adhoc’)

I was able to get flask-oidc to work with https by routing all http traffic in Nginx to https. I would seem to me that using oidc with https is basic but I could not get a workable solution without routing http traffic. Would love to see one.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.