Commit graph

55 commits

Author SHA1 Message Date
Akhil Narang
6204ff351c
fix(oauth): convert email to lowercase
All user emails are stored as lowercase, but OAuth provider could have it in mixed case.
We pass the email as-is to LoginManager, which could result in a session with an incorrect email.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-12-23 18:15:30 +05:30
sokumon
dd2dc053ca chore: more renames to /desk 2025-12-18 20:45:04 +05:30
Akhil Narang
1e5aaac000
fix(oauth): drop keycloak check (#34330)
Not needed anymore

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2025-10-09 12:10:21 +00:00
Chris Hemmings
fbf07ddf6e
fix: OAuth2 absolute authorize, access token and api urls (#34266)
* fix: OAuth2 absolute authorize, access token and api urls

* fix: add back keycloak check, just use the function instead

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
2025-10-09 16:47:38 +05:30
Gavin D'souza
bc81e340c7
fix: Move on_session_creation hook after session is created 2025-03-05 11:27:21 +01:00
Gavin D'souza
00a6345012
fix: Run on_session_creation on OAuth logins
Closes https://github.com/frappe/frappe/issues/31409
2025-02-24 14:05:43 +01:00
Akhil Narang
84ef6ec677
refactor: fixup with ruff 0.8.1
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 13:18:04 +05:30
Akhil Narang
71b869a975
refactor(keycloak): set API endpoint while getting list of oauth providers
urljoin() just adds the base URL to the relative path, here our base URL has an extra route in the path which isn't added in.

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-09-19 15:31:32 +05:30
Shariq Ansari
44eccd6135 fix: redirect to default path via social login 2024-08-13 12:23:20 +05:30
Akhil Narang
3f1e19de85
refactor(treewide): enable RUF rules
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-02-21 16:20:28 +05:30
Ankush Menat
de9ac89748 style: re-format with ruff 2024-02-05 18:53:33 +05:30
Ankush Menat
e1f2f4bb54 fix: Let social login key control signups
There are cases where certain social login keys

- Should not allow signups at all and only allow logins. E.g. social media login keys.
- Should allow signups even if global sign ups are disabled. e.g. internal SSO like setups.
2023-10-14 12:43:48 +05:30
Ankush Menat
adf30693a9 ci: update pyupgrade 2023-07-14 14:24:08 +05:30
Ankush Menat
793f4ebba3 perf: defer loading JWT 2023-06-24 19:50:08 +05:30
Ankush Menat
fa6dc03cc8
refactor: frappe.cache() usage to frappe.cache (#21282) 2023-06-08 11:47:17 +05:30
gavin
2571876d66 chore(oauth): Make provider typing optional in redirect_post_login
Co-authored-by: Ritwik Puri <ritwikpuri5678@gmail.com>
2023-01-03 14:28:56 +05:30
Gavin D'souza
d13c377848 refactor: OAuth
* Added typing hints for Oauth APIs and dependant utils
* Simplify oauth core flows
* Remove long commented code
* Use newer, simpler syntax for better readability
2022-12-27 19:25:43 +05:30
Ankush Menat
f34f7030a3 refactor: remove txt param from generate_hash use 2022-11-10 11:56:48 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Jannat Patel
88d8c1e56a fix: public info api 2021-11-08 20:17:07 +05:30
Jannat Patel
49e084868b fix: indentation and filter condition 2021-11-03 15:24:23 +05:30
Jannat Patel
f3f01d1978 fix: github api endpoint 2021-11-03 14:58:16 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
165ff8e1bf chore: Update PyJWT dependency
* Update pinned dep fromm 1.7.1 to 2.0.1
* Updated usages as per changelog

ref: https://python.libhunt.com/pyjwt-changelog
2021-05-29 17:22:30 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
leela
1c2d69fbe7 fix: remove the token validation check
Let token be part of state to make state dynamic. But there is no need
to have validation for token.
2021-04-19 14:51:53 +05:30
Sagar Vora
5cd3f8534b fix: create gender only if provided while creating oauth user 2021-03-09 16:47:21 +05:30
Suraj Shetty
ce379bc200 Merge branch 'develop' of https://github.com/frappe/frappe into rebrand-ui 2021-01-28 19:56:54 +05:30
Suraj Shetty
a2fba77116
fix: Skip translation of gender while creating it (#12260) 2021-01-25 15:37:37 +05:30
Rushabh Mehta
06355968f8 fix(routes): move /app#route to /app/route 2020-11-11 16:35:02 +05:30
Rushabh Mehta
75fe8a615a feat(app): move /desk to /app 2020-11-11 16:31:47 +05:30
Raffael Meyer
125409e7b8
Merge branch 'develop' into generic_oauth_client 2020-08-19 12:15:01 +02:00
barredterra
27b9010c08 fix: redirect to desk#workspace instead of desk#desktop 2020-08-13 12:38:44 +02:00
Deepesh Garg
5af0674315 fix: Redirect to workspace instead of desktop 2020-08-03 14:40:07 +05:30
Deepesh Garg
ccf7f28d98 fix: get url only if redirect_to is not specified 2020-08-03 14:38:46 +05:30
Deepesh Garg
589a9b1d0f fix: OAUTH redirect fixes 2020-07-27 18:12:29 +05:30
Rohan Bansal
8590ff0477 fix: add default role on sign up via SSO 2019-12-06 15:28:09 +05:30
Revant Nandgaonkar
314aed831b fix: add missing code for social login key
add missing code for using custom social login key
2019-10-30 17:26:45 +05:30
mergify[bot]
8f94a9d0a0
Merge pull request #8009 from scmmishra/fix-oauth-hotfix
fix: oauth redirect issue
2019-07-29 06:21:27 +00:00
Shivam Mishra
577f3c8897 fix: redirect for OAuth 2019-07-26 14:27:14 +05:30
lapphan
af35e82b1b
fix: Check wrong OpenID's spec email claims 2019-07-25 23:10:24 +07:00
jibin jose
5cec97a0a2 Fix social login in Python3
In Pyhton3, requests response content is in bytes type. So decoder
have to handle both `str` and `bytes` to make it compatible with
both python 2 and 3
2019-04-05 16:41:25 +05:30
Roland
2a2e3ca0af fairlogin social ID provider (#6096)
* fairlogin

adding fairlogin provider

* fairlogin

add fairlogin provider

* fairlogin

* fairlogin

* fairlogin userid

fairlogin userid corrected to preferred_username

* removed trailing white space

* removed trailing white space

removing white space mourned by automated code review
2018-09-25 15:35:46 +05:30
Alchez
88c31d27e3 Fix tuple index bug in string formatting (#5632) 2018-06-01 12:13:27 +05:30
yogeshak
51f5988a76 JWT response does not contain email attribute for Office 365, reading upn instead (#5525) 2018-05-16 11:13:17 +05:30
Revant Nandgaonkar
5f22459013 Salesforce social login (#4819)
* Added Salesforce Social Login

* [Docs] Generate client_id client_secret for login providers

* [Fix] salesforce userid

Saleforce sub from openid is https://login.salesforce.com/id/ABC/XYZ
Extracting ABC/XYZ
2018-01-19 12:23:37 +05:30
Revant Nandgaonkar
02aa7b6f41 Social login refactor (#4519)
* Added DocType Social Login Key

WIP for https://github.com/frappe/frappe/issues/4496
added basic fields
after_insert add provider_username and provider_userid fields on User dt
on_trash deletes added fields on User dt

* Added field to store fontawesome icon for provider

* [Patch] Social Login Keys to Social Login Key

* [Patch] Social Login Keys to Social Login Key

* Social Login Key generates boilerplate

* patch fixed for social_login_refactor

* removed patch-not working

* use social login keys to initiate flow

* Login page shows Social Login Key

* show login via if base_url present

* removed boilerplate generator

* Multiple Changes

fix zxcvbn import in password_strength.py
use of child table instead of additional fields on user dt to store username and userid

* Fetched Template on Client JS

* Frappe social login template working

* Added Social Login Key Templates

* Codacy fixes and validate social login key urls

* [Patch] Social Login Keys (untested)

* [Fix] Patch refactor social login keys

* [Fix] Patch refactor_social_login_keys manually tested

* Refactor OAuth 2.0 related changes for Social Login Key

* [Fix] Patch refactor social login keys

* Test - Adding Frappe Social Login Key

* Social Login Key Tests

check added child table entry on user for provider frappe
it also checks if userid is created

* [WIP] Office 365 Social Login Key Template

* [Fix] Social Login - Redirect URL

* [Test] Single sign-on icons for added provider

* [Fix] Codacy Errors

* [Fix] Social Login Key Form JS

* Docs Added for Social Login Key

* [Fix] Patch Refactor Social Login Keys

* Handle different icon types

Handle different icon types (image, icon, emoji) with just icon field

* Move the login methods to a new py file

frappe.integrations.oauth2_logins added
copied whitelisted guest oauth2 redirect endpoints from login.py
removing the functions from login.py will break backward compatibility

* Social Login Key Form Changes

Moved Enable field to top
Fields which are not editable are collapsed

* [Fix] Codacy Errors

* Corrected Docs, sync.py

* [Docs] Adding a social login provider

* [Fix] set frappe userid from User Social Login

* [Fix] frappe userid in oauth.py

* removed icon_type

* Use frappe.utils.is_image
2018-01-03 14:57:16 +05:30
Aditya Hase
769338f136 Replaced all instances of basestring with six.string_types 2017-08-11 00:10:11 +05:30
Saurabh
7620bb3789 Deprecate Integration Broker (#2831)
* [fix] remove razorpay from integration service

* [fix] clean-up js side integration service dependancies

* [fix] remove integration service, .py cleanup, move integration request to integration

* [fix] move oauth to integrations and deprecate integration broker

* [fix] mark services enabled and update integrations listing

* [fix] V7.1 and V7.2 integration service related pathch fixes and move payment gateway dotype to core module

* [fix] create payment gateway records if not exists

* [fix] module page for integrations

* [minor][fix] minor checks

* [fix] remove integration broker module only if not allocated to any doctype
2017-03-14 11:24:26 +05:30