Currently I am developing a custom login page. I want to use oauth2
I have username , password fields.
On click of login button I am invoking the below end point to authenticate the user
curl -i ^
More? -H "Authorization: <BASE64(client_id:client_secret)>" ^
More? -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" ^
More? -X POST "https://idcs-endpoint/oauth2/v1/token" ^
More? --data-urlencode "grant_type=password" ^
More? --data-urlencode "username=abcd" ^
More? --data-urlencode "password=xyz" ^
More? --data-urlencode "scope=urn:opc:idm:__myscopes__"

I was referring the oracle document for reference:
https://docs.oracle.com/en/cloud/paas/identity-cloud/idcsa/ROWebServerAppAuth.html
Below are the few reference api calls.

All users must be able to authenticate using the above end point but it is failing with grant_type as password.
I need to validate with username/password to proceed further. Also I tried with each scopes but same result.
Thanks,
Animesh