Implement oauth.py in your app instead of frappe.oauth
Refer frappe/integrations/oauth2.py and implement your own endpoints importing your oauth implementation instead of using frappeās
Optionally, in hooks override whitelisted functions from frappe.integrations.oauth2 by functions from your app. Or you need to change endpoints as per your appās module structure.
Frappe uses client_secret (HS256) to sign and verify id_token, if you implement jwks verification then send it as PR, it may be slower than custom app to implement. Itāll be reviewed by frappe developers and community contributors. Itāll help community.
private keys: can be added to some āsettingsā doctype as child table, it can then also rotate using scheduler events, keep number_of_keys at a time, add new and remove old every rotation_interval days. number_of_keys will always be present at a time.
add jwks endpoint to publish public keys
āsettingsā will specify HS256 or RS256, default to RS256, publish the algo used in frappe.integrations.oauth2.openid_configuration
Hi @Dhaval_Dalwadi,
Did you figured out implementing JWKS or something else ?
I am trying to use frappe as auth provider over all my sites/apps running in my kubernetes cluster.
I tried to use oauth2-proxy with frappe, so to not handle any kind of auth etc in my apps. but due to jwks not being implemented it throws 500 after login and never redirects to original url. Error redeeming code during OAuth2 callback: could not verify id_token: failed to verify token: failed to verify signature: fetching keys oidc: get keys failed Get "": unsupported protocol scheme ""
I am using erpnext in a kubernetes setup and wanted some of my webapps to have frappe as auth provider.
Earlier I was using keycloak with oauth2-proxy(Welcome | OAuth2 Proxy). As it requires JWKS to supported by auth provider. So have tried it and the custom image with this patch just works.
It would be helpful to get some feedback before sending a pr.