How to use Amazon Cognito Userpools with custom UI and also OIDC

When building web services and REST APIs on AWS, Amazon Cognito Userpools is often used for authentication and authorization. However, one limitation of the Amazon Cognito Userpools is that if you use a custom UI for the authentication page, the OIDC, Open ID Connect endpoint itself will not be ava…