Is there any sample code to make GET and POST request to /auth endpoint?

I need to call /auth end point to obtain authorization code. Which I will use to get token from /token endpoint. My current python/lambda code returns the “login page” as a response. I want to bypass username/password login, and use the user certificate to login. Can someone please provide sample code for GET as well as POST request for /auth endpoint.