Integration testing the redirect flow (golang)

I’ve followed Sign users in to your web app using the redirect model | Okta Developer and have a working system tested manually against a dev okta domain.

I’d like to write automated integration tests for the whole flow, but am stuck at the redirect step.

I can query my /login route, and I get back html from containing the username&password form the user is supposed to fill out, but don’t know what query containing what information to what endpoint I’m supposed to make to continue the flow in an automated test, as if I was a user filling out the form in a web brower.

Does anyone have an example of them testing this flow they can share? Or know what the form does and how to replicate it without a web browser?

In case anyone else needs this, I ended up testing it like this: wrstat/server_test.go at 2f93131cbf6d739f166c58a4afa0dec8949953aa · wtsi-ssg/wrstat · GitHub

Ie. Use the authn endpoint to login with username&password, and pass the session token and other bits in to the flow.

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