1. Go to Site administration -> Plugins
2. Click on Manage authentication
3. In the table "Available authentication plugins" look for OAuth 2 and click the enable button so that the eye icon isn't greyed out
The Not configured warning triangle suggests you haven't added the endpoints needed for login.
You must also have enabled OAuth 2 on the Manage Authentication page.
when i click to login it navigates me to a keycloak path that it says not found invalid url
A URL on the Keycloak server? Is it one of the endpoints you've set in Moodle for this service? In which case surely one of the endpoints is wrong.
Based on this Stack Overflow answer the endpoints are:
- authorization_endpoint: …/auth/realms/<your_realm>/protocol/openid-connect/auth
- token_endpoint: …/auth/realms/<your_realm>/protocol/openid-connect/token
- userinfo_endpoint: …/auth/realms/<your_realm>/protocol/openid-connect/userinfo
The endpoints you've entered for Keycloak in Moodle can be tried in your browser. You should see an access denied message (because you're not providing the required parameters) but you should not see a 404 Not Found page. If you do then that endpoint URL is wrong.
If you're still having problems maybe a screenshot will help us understand the problem.