How to enable ouath2 using api

We are trying to sign in to sugarcrm on behalf of our users with the help of the api which uses oauth2.

Right now there is a requirement to add the username and password when trying to authenticate into sugarcrm using the api.
It can be seen in this document.

But this type of authentication asks for the username and password which is not recommended by ouath2.

Ask : Is there a way to ask the user their clientId and clientSecret wherein the person is redirected to the sugarcrm login and page and once they login they are redirected back to our applicaiton?