❔ HttpListener for single use request
Haven't found any useful answers online.
I've got a console app where I want to open the user's main browser to an oauth login page. The callback leads back to the program at localhost. So I believe I need to run an httplistener to capture this callback. However this is the only use I would have in the program's lifetime for the httplistener. The rest of the authorization flow can be maintained through an httpclient.
Is it viable or acceptable to spin up and dispose an httplistener like this? Maybe there's a better option for temporary listeners with asp? Or am I overthinking this and there's another solution?
I've got a console app where I want to open the user's main browser to an oauth login page. The callback leads back to the program at localhost. So I believe I need to run an httplistener to capture this callback. However this is the only use I would have in the program's lifetime for the httplistener. The rest of the authorization flow can be maintained through an httpclient.
Is it viable or acceptable to spin up and dispose an httplistener like this? Maybe there's a better option for temporary listeners with asp? Or am I overthinking this and there's another solution?