Bug 2069202

Summary: [RFE] add support for authenticating against external IdP services using OAUTH2 preauthenticaiton mechanism provided by SSSD
Product: Red Hat Enterprise Linux 9 Reporter: Alexander Bokovoy <abokovoy>
Component: ipaAssignee: Alexander Bokovoy <abokovoy>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact: Josip Vilicic <jvilicic>
Priority: unspecified    
Version: 9.1CC: aboscatt, amore, atikhono, erich.birngruber, frenaud, ftrivino, gfialova, jvilicic, myusuf, pasik, rcritten, spoore, tscherf, vvanhaft
Target Milestone: rcKeywords: FutureFeature, TechPreview, Triaged
Target Release: ---Flags: jvilicic: needinfo+
pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-4.9.10-1.el9 Doc Type: Technology Preview
Doc Text:
.RHEL IdM allows delegating user authentication to external identity providers as a Technology Preview In RHEL IdM, you can now associate users with external identity providers (IdP) that support the OAuth 2 device authorization flow. When these users authenticate with the SSSD version available in RHEL 9.1 or later, they receive RHEL IdM single sign-on capabilities with Kerberos tickets after performing authentication and authorization at the external IdP. Notable features include: * Adding, modifying, and deleting references to external IdPs with `ipa idp-*` commands * Enabling IdP authentication for users with the `ipa user-mod --user-auth-type=idp` command For additional information, see link:https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/managing_idm_users_groups_hosts_and_access_control_rules/assembly_using-external-identity-providers-to-authenticate-to-idm_managing-users-groups-hosts[Using external identity providers to authenticate to IdM].
Story Points: ---
Clone Of:
: 2101770 (view as bug list) Environment:
Last Closed: 2022-11-15 10:00:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2056482    
Bug Blocks:    

Description Alexander Bokovoy 2022-03-28 13:13:48 UTC
Via bug 2056482, SSSD adds client and KDC sides of a preauthentication mechanism to MIT Kerberos to authenticate against externally hosted identity provider (IdP) with OAuth2 protocol. The preauthentication mechanism is called 'idp'.

'idp' preauthentication mechanism relies on KDC side on the code in FreeIPA KDB driver, currently being developed at https://github.com/abbra/freeipa/tree/external-idp. The code will eventually be merged into FreeIPA upstream and represents both KDB driver development and IPA management around IdP entities. IdP entities are modeled after RADIUS proxy support already present in FreeIPA.

This bug tracks integration of initial support for the external IdPs of FreeIPA in RHEL.

Comment 7 Florence Blanc-Renaud 2022-06-22 19:01:57 UTC
Tests added upstream in ipatests/test_integration/test_idp.py

master:

    5ca4e8e pr-ci definitions: add external idp related jobs.
    9cc703f ipatests: Add integration tests for External IdP support

    a80a981 ipatests: update prci definitions for test_idp.py
    bd57ff3 Add end to end integration tests for external IdP


ipa-4-9:

    b979dd9 ipatests: Add integration tests for External IdP support
    b39f933 pr-ci definitions: add external idp related jobs.

Comment 8 Florence Blanc-Renaud 2022-06-23 11:45:37 UTC
Tests:
ipa-4-9:

    857713c Add end to end integration tests for external IdP
    50b4d9a ipatests: update prci definitions for test_idp.py

Comment 13 anuja 2022-07-12 08:40:39 UTC
Verified using nightly compose:

A) Using Versions:
ipa-server-4.10.0-2.el9.x86_64
sssd-idp-2.7.1-2.el9.x86_64

B)) Test result.out
============================= test session starts ==============================
platform linux -- Python 3.9.13, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3
cachedir: /home/cloud-user/.pytest_cache
metadata: {'Python': '3.9.13', 'Platform': 'Linux-5.14.0-127.el9.x86_64-x86_64-with-glibc2.34', 'Packages': {'pytest': '6.2.2', 'py': '1.10.0', 'pluggy': '0.13.1'}, 'Plugins': {'metadata': '1.7.0', 'multihost': '3.0', 'html': '3.1.1', 'sourceorder': '0.6.0'}}
rootdir: /usr/lib/python3.9/site-packages/ipatests
plugins: metadata-1.7.0, multihost-3.0, html-3.1.1, sourceorder-0.6.0
collecting ... collected 6 items

test_integration/test_idp.py::TestIDPKeycloak::test_auth_keycloak_idp PASSED [ 16%]
test_integration/test_idp.py::TestIDPKeycloak::test_auth_hbac PASSED     [ 33%]
test_integration/test_idp.py::TestIDPKeycloak::test_auth_sudo_idp PASSED [ 50%]
test_integration/test_idp.py::TestIDPKeycloak::test_auth_replica PASSED  [ 66%]
test_integration/test_idp.py::TestIDPKeycloak::test_idp_with_services PASSED [ 83%]
test_integration/test_idp.py::TestIDPKeycloak::test_idp_backup_restore PASSED [100%]

Comment 21 errata-xmlrpc 2022-11-15 10:00:08 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 (ipa bug fix and enhancement update), 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/RHBA-2022:7988