Parcourir la source

fix(oauth): Send id_token of the authorized user instead of Guest

This only affects OAuth clients that use `id_token` obtained from `frappe.integrations.oauth2.get_token`.

Doesn't affect OAuth clients that ignore id_token and explicitly use `frappe.integrations.oauth2.openid_profile` endpoint for getting user details. e.g. Frappe OAuth client.

A simple way to replicate this is to setup Frappe-Frappe OAuth client-server pair and use `login_via_oauth2_id_token` instead of `login_via_oauth2` in `login_via_frappe`.
version-14
Aditya Hase il y a 3 ans
Parent
révision
93320ce6e7
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: A55F0FCA0234972
1 fichiers modifiés avec 1 ajouts et 4 suppressions
  1. +1
    -4
      frappe/oauth.py

+ 1
- 4
frappe/oauth.py Voir le fichier

@@ -323,10 +323,7 @@ class OAuthWebRequestValidator(RequestValidator):
# Check whether frappe server URL is set
id_token_header = {"typ": "jwt", "alg": "HS256"}

user = frappe.get_doc(
"User",
frappe.session.user,
)
user = frappe.get_doc("User", request.user)

if request.nonce:
id_token["nonce"] = request.nonce


Chargement…
Annuler
Enregistrer