Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2089828 - default Organization and location not set for AD users
Summary: default Organization and location not set for AD users
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Authentication
Version: 6.10.5
Hardware: All
OS: All
unspecified
medium
Target Milestone: 6.12.0
Assignee: Adam Ruzicka
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
: 2111445 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-24 14:10 UTC by Jan Jansky
Modified: 2024-04-11 13:35 UTC (History)
10 users (show)

Fixed In Version: foreman-3.3.0.12-1,foreman-3.3.0.16-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-16 13:33:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 34949 0 Normal Closed Taxonomies are being set during extlogin too early, leading to user's default taxonomies being ignored 2022-09-21 06:02:35 UTC
Github theforeman foreman pull 9442 0 None Merged Refs #34949 - Do not set taxonomies during extlogin 2022-09-30 10:15:18 UTC
Red Hat Issue Tracker SAT-12905 0 None None None 2022-09-13 08:19:10 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:34:04 UTC

Description Jan Jansky 2022-05-24 14:10:17 UTC
Description of problem:
During external authentication wrong organization and location is selected.

Version-Release number of selected component (if applicable):


How reproducible: aruzicka reproduced


Steps to Reproduce:
1. Create User with external authentication
2. Set Default organization and location for ext user
3. Login to WebUI

Actual results:
Default organization and location is not set correctly

Expected results:
Default organization and location will be set correctly

Additional info:


/var/log/foreman/production.log

2022-03-25T00:00:00 [I|app|ea079fdc] Started GET "/users/extlogin" for xxx.xxx.xxx.xxx at 2022-03-25 00:00:00 +0300
2022-03-25T00:00:00 [I|app|ea079fdc] Processing by UsersController#extlogin as HTML
2022-03-25T00:00:00 [I|app|ea079fdc] Authorized user ext_user(ext_user)
2022-03-25T00:00:00 [D|app|ea079fdc] Post-login processing for ext_user
2022-03-25T00:00:00 [D|tax|ea079fdc] Current location set to none         <<<<<
2022-03-25T00:00:00 [D|tax|ea079fdc] Current organization set to none     <<<<<
2022-03-25T00:00:00 [D|tax|ea079fdc] Current location set to none         <<<<<
2022-03-25T00:00:00 [D|tax|ea079fdc] Current organization set to none     <<<<<
2022-03-25T00:00:00 [I|app|ea079fdc] User 'ext_user' logged in from 'xxx.xxx.xxx.xxx'
2022-03-25T00:00:00 [I|app|ea079fdc] Redirected to https://satellite.example.com/
2022-03-25T00:00:00 [D|app|ea079fdc] Post-login processing for ext_user
2022-03-25T00:00:00 [I|app|ea079fdc] Completed 302 Found in 77ms (ActiveRecord: 25.8ms | Allocations: 23757)

DB

# su - postgres -c "psql foreman -c \"select id,login,mail,default_organization_id,default_location_id from users where mail = 'mail';\""
 id |        login        |          mail           | default_organization_id | default_location_id 
----+---------------------+-------------------------+-------------------------+---------------------
  6 | ext_user | mail         |                       1 |                   2
(1 row)

# su - postgres -c "psql foreman -c \"select * from taxonomies;\""
 id |  name   |     type     |         created_at         |         updated_at         |      ignore_types      | description |  label  | ancestry |  title  |   manifest_refreshed_at    | created_in_katello 
----+---------+--------------+----------------------------+----------------------------+------------------------+-------------+---------+----------+---------+----------------------------+--------------------
  2 |Location | Location     | 2022-02-13 00:00:00.000000 | 2022-02-13 00:00:00.000000 | ---                   +|             |         |          | Location|                            | f
    |         |              |                            |                            | - ProvisioningTemplate+|             |         |          |         |                            | 
    |         |              |                            |                            | - Hostgroup           +|             |         |          |         |                            | 
    |         |              |                            |                            |                        |             |         |          |         |                            | 
  1 | Org     | Organization | 2022-02-13 00:00:00.000000 | 2022-02-13 00:00:00.000000 |                        |             | Org     |          | Org     | 2022-02-13 00:00:00.000000 | t
(2 rows)

Comment 3 Adam Ruzicka 2022-09-13 07:53:06 UTC
*** Bug 2111445 has been marked as a duplicate of this bug. ***

Comment 4 Bryan Kearney 2022-09-20 20:04:04 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34949 has been resolved.

Comment 6 Vladimír Sedmík 2022-09-29 14:24:39 UTC
Tested in 6.12.0 snap 12:
The fix works well for external users with only 1 org/loc assigned. When the user is assigned to more orgs/locs, Any org/loc is selected on login, regardless the `Default on login` settings.

Comment 8 Vladimír Sedmík 2022-10-11 09:30:33 UTC
Verified in 6.12.0 snap 14 - now the AD external user with multiple orgs and locs assigned has correct taxonomy set on login according to the `Default on login` settings.

Comment 12 errata-xmlrpc 2022-11-16 13:33:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.12 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8506


Note You need to log in before you can comment on or make changes to this bug.