I can trying to fetch the oauth2 token from token url .I am using authorisation code flow in Oauth2 . For the token url call ,mandatory parameter is code. So I need to do a get call on authorization url and get the code. In postman while doing the authorization call I am getting redirect page(ui to enter credentials) .Is there any other way to fetch the token using this flow without going through ui as this is specifically testing api This is for API Automation Testing.
Microsoft documentation attached - https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow