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
已提問 1 個月前檢視次數 50 次
沒有答案

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南