Why Does `/oauth2/login` returns CORS error with Custom UI?

0

I have created simple UI form for Login in my app.

I wanted to integrate this Custom UI with AWS **Cognito **implementing OAuth 2.0 Authorization Code Grant Type as this the recommended grant_type for mobile and web apps.

However, I am facing issues when trying to use my UI for hitting endpoints like /oauth2/authorize, /oauth2/login without using the Cognito's Hosted UI.

The flow works fine when using the Hosted UI.

However, when implementing same flow with custom UI I receive CORS error when hitting the /oauth2/login endpoint with request body params (username, password) and query params (response_type=code&client_id=MY_CLIENT_ID&redirect_uri=MY_REDIRECT_URI) and headers ("Content-Type" : "x-www-form-url-encoded").

I tried adding "Allow-Control-Access-Origin" : "*" header, but nothing changed unfortunately.

arsany
질문됨 한 달 전51회 조회
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인