Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 21, 2022

Conversation

jvillafanez
Copy link
Member

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 owncloud/core#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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • ...

@DeepDiver1975
Copy link
Member

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

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

@IljaN
Copy link
Member

IljaN commented Dec 19, 2022

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.

older core-versions do not have the third argument
@IljaN IljaN force-pushed the send_authmodule_to_login branch from ea94ca4 to 0062339 Compare December 21, 2022 11:00
@sonarqubecloud
Copy link

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

@IljaN IljaN requested review from DeepDiver1975 and IljaN December 21, 2022 11:09
@IljaN IljaN merged commit 4a65896 into master Dec 21, 2022
@delete-merged-branch delete-merged-branch bot deleted the send_authmodule_to_login branch December 21, 2022 14:02
This was referenced Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants