Handling response from self hosted widget in PHP

Using the self hosted widget in my Symfony application it will successfully go to Okta and authenticate the user. In the response to the redirect where I’m trying to authenticate the user server side I see a code and a state value. How do I get an access token from these?