Преглед на файлове

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 преди 3 години
родител
ревизия
93320ce6e7
No known key found for this signature in database GPG ключ ID: A55F0FCA0234972
променени са 1 файла, в които са добавени 1 реда и са изтрити 4 реда
  1. +1
    -4
      frappe/oauth.py

+ 1
- 4
frappe/oauth.py Целия файл

@@ -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


Зареждане…
Отказ
Запис