Login in Okta without redirect

So im getting the session token through /authn and now i need to get an access token. Is it possible to do this without getting redirected to the okta login page? if so how?
Also i tried to use the /oauth2/v1/authorize route but i always get an 404 error.