owncloud / openidconnect

OpenId Connect (OIDC) Integration for ownCloud
GNU General Public License v2.0
5 stars 2 forks source link

Send to auth module so the login type is recognized in core #272

Closed jvillafanez closed 1 year ago

jvillafanez commented 1 year ago

Description

Send the auth module class in the login function to core can recognize the login type. This means that login via openid connect using the login button will be recognized as such login type, otherwise core won't be able to recognize it as an openid connect login.

The change is expected to be backwards-compatible with all ownCloud versions. Sending more parameters that what are required shouldn't cause problems

Related Issue

Piece for https://github.com/owncloud/enterprise/issues/5295

Motivation and Context

How Has This Been Tested?

  1. Setup openidconnect app and user_ldap
  2. Login via openidconnect in ownCloud

A log entry (info level) is expected notifying the login with the openidconnect module. Note that https://github.com/owncloud/core/pull/40520 is required for the log entry to appear:

{"reqId":"8JyBTNO5KCTSDbTkHFZB","level":1,"time":"2022-12-14T16:58:44+00:00","remoteAddr":"10.0.2.27","user":"--","app":"OC\\User\\Session::loginInOwnCloud","method":"GET","url":"\/apps\/openidconnect\/redirect?state=78c704ed53c4a50a80eadcc149a0b518&session_state=539d178d-9800-4b59-b997-44d0d2875e87&code=4fbe55b7-68ad-4e25-9622-de8c90d8de66.539d178d-9800-4b59-b997-44d0d2875e87.e5ac9036-7d1f-4d9d-8f48-67542ef31744","message":"login 9c7efba2-d008-1036-8559-dd0c704ad877 using \"OCA\\OpenIdConnect\\OpenIdConnectAuthModule\" login type"}

Screenshots (if appropriate):

Types of changes

Checklist:

Open tasks:

DeepDiver1975 commented 1 year ago

phpstan does not like this .... maybe some reflection magic is necessary ...

Screenshot from 2022-12-19 10-48-40

IljaN commented 1 year ago

Passing too many arguments to a function is indeed legal in php. So we could add /* @phpstan-ignore-line / or be more explicit as deepdiver suggested. Maybe no reflection needed and we can use call_user_func_array or similar.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication