Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Mon 10862 allow to do not defined redirect url #10098

Merged
merged 14 commits into from
Sep 14, 2021

Conversation

lpinsivy
Copy link
Contributor

@lpinsivy lpinsivy commented Sep 8, 2021

Description

Replace #9877

We have two Centreon-UIs using the same database and want to enable OpenID Connect for both instances. Originally both share the same redirect URL. We would like each instance to use the hostname the user connected to.

This patch adds three variables that can be used for substitution in the redirect URL:

{$scheme} for http/https
{$hostname} hostname or ip address the user used to access this Centreon-UI
{$port} port used to access the Centreon-UI
So this can be formed to something like {$scheme}://{$hostname}:{$port}/centreon/index.php

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 20.04.x
  • 20.10.x
  • 21.04.x
  • 21.10.x (master)

How this pull request can be tested ?

Use all variables as OpenID Connect Redirect URL or only some of them

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

jeremyjaouen
jeremyjaouen previously approved these changes Sep 9, 2021
www/class/centreonAuth.SSO.class.php Outdated Show resolved Hide resolved
www/class/centreonAuth.SSO.class.php Outdated Show resolved Hide resolved
www/include/Administration/parameters/general/help.php Outdated Show resolved Hide resolved
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
lpinsivy and others added 2 commits September 9, 2021 17:17
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
@sonarqube-decoration
Copy link

SonarQube Quality Gate:
Quality Gate passed

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

No Coverage information No Coverage information
7.7% 7.7% Duplication

@lpinsivy lpinsivy merged commit 4e0b5dd into develop Sep 14, 2021
@lpinsivy lpinsivy deleted the MON-10862-Allow-to-do-not-defined-redirect-URL branch September 14, 2021 07:50
lpinsivy added a commit that referenced this pull request Sep 14, 2021
* Add variables for substitutions on openid_connect_redirect_url

* Use a default redirect_url if empty

* remove tabs, again

* Split string into two lines to match centreon coding style

* use configured Centreon path as default

* reduce line lenght to match Centreon style guides

* Improve closing DB cursor

* Replace SQL query for oreon_web_path with ssoOptions

* split line to comply with style guide

* enh(openid): Allow to do not defined redirect URL

* Update www/class/centreonAuth.SSO.class.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

* Update www/class/centreonAuth.SSO.class.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

* Update www/include/Administration/parameters/general/help.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

Co-authored-by: Stefan Mayr <stefan@mayr-stefan.de>
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
lpinsivy added a commit that referenced this pull request Oct 13, 2021
* Add variables for substitutions on openid_connect_redirect_url

* Use a default redirect_url if empty

* remove tabs, again

* Split string into two lines to match centreon coding style

* use configured Centreon path as default

* reduce line lenght to match Centreon style guides

* Improve closing DB cursor

* Replace SQL query for oreon_web_path with ssoOptions

* split line to comply with style guide

* enh(openid): Allow to do not defined redirect URL

* Update www/class/centreonAuth.SSO.class.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

* Update www/class/centreonAuth.SSO.class.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

* Update www/include/Administration/parameters/general/help.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

Co-authored-by: Stefan Mayr <stefan@mayr-stefan.de>
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
lpinsivy added a commit that referenced this pull request Oct 13, 2021
* Add variables for substitutions on openid_connect_redirect_url

* Use a default redirect_url if empty

* remove tabs, again

* Split string into two lines to match centreon coding style

* use configured Centreon path as default

* reduce line lenght to match Centreon style guides

* Improve closing DB cursor

* Replace SQL query for oreon_web_path with ssoOptions

* split line to comply with style guide

* enh(openid): Allow to do not defined redirect URL

* Update www/class/centreonAuth.SSO.class.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

* Update www/class/centreonAuth.SSO.class.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

* Update www/include/Administration/parameters/general/help.php

Co-authored-by: Laurent Calvet <lcalvet@centreon.com>

Co-authored-by: Stefan Mayr <stefan@mayr-stefan.de>
Co-authored-by: Laurent Calvet <lcalvet@centreon.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants