ygbgames
ygbgames

Reputation: 211

How to test flask-okta integration?

I have implemented okta integration in flask using oidc.

@route(“/index”)
@oidc.require_login
def index():
    return “ok”

I wanted to write integration test using webtest but instead of 200 getting 302 as oidc is redirecting to okta url.

How can in bypass authentication during test cases exexution

Upvotes: 1

Views: 213

Answers (1)

ygbgames
ygbgames

Reputation: 211

Require login always checks if the oidc_id_token is exists and not expired. We can manually set for the test environment.

oidc.set_id_token_cookie({‘exp’:unixtime})

Upvotes: 0

Related Questions