Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2138743

Summary: Satellite OAuth returns non-compliant token field expires_at
Product: Red Hat Satellite Reporter: Brendan Shephard <bshephar>
Component: APIAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.11.0CC: apatel, aruzicka, iballou
Target Milestone: UnspecifiedKeywords: EasyFix, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-10-31 18:23:25 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:

Description Brendan Shephard 2022-10-31 05:24:21 UTC
Description of problem:
When using bearer tokens with Satellite. The token contains an expires_at field. The expires_at field is not part of the RFC for OAuth. Rather it should be expires_in.

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

How reproducible:
Easily

Steps to Reproduce:
1. Request a OAuth token ( We authenticate and return the token like this:
https://github.com/openstack/tripleo-common/blob/master/tripleo_common/image/image_uploader.py#L326)

2. Check contents of token:
{'token': '$2a$09$1b6453892473a467d0737uJ56J02CLEXEkOaX0pdLWgLMlg.qWDSi',
'expires_at': '2022-10-28T04:54:58.296Z',
'issued_at': '2022-10-17T23:45:09.306Z'}

3. Observe expires_at field that is not valid per the RFC for OAuth:
https://www.rfc-editor.org/rfc/rfc6749#section-4.2.2


Actual results:
'expires_at': '2022-10-28T04:54:58.296Z'

Expected results:
The response should adhere to the RFC and contain a `expires_in` field. This field indicates the number of seconds since the issued_at time.

Additional info:
Upstream issue raised as well:
https://projects.theforeman.org/issues/35690

This is impacting us with new versions of Satellite here:
https://bugzilla.redhat.com/show_bug.cgi?id=2134075

Comment 1 Adam Ruzicka 2023-10-03 12:39:34 UTC
Just to be extra sure, would it be ok if we included "expires_in" field in addition to the non-standard field we already have there or is the ask to replace one with the other?

Comment 2 Brendan Shephard 2023-10-04 09:30:08 UTC
(In reply to Adam Ruzicka from comment #1)
> Just to be extra sure, would it be ok if we included "expires_in" field in
> addition to the non-standard field we already have there or is the ask to
> replace one with the other?

I mean, adding the field would solve the issue I had while integrating with Satellite. So that would be fine from my perspective. Whether or not you should implement the RFC without the expires_at field is probably a seperate question. I'm not sure if there would be any security related concerns with keeping expires_at, it seems as though it was initially included in one of the early OAuth proposals, but then removed when the OAuth v2 RFC was published, maybe there was a reason for that removal that requires further exploration?

Short answer is, "Yes, my query on this BZ is really about having Satellite return the expected expires_in field. Including it in addition to would solve my problem."

Comment 3 Ian Ballou 2023-10-31 18:23:25 UTC
Closing as a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2229810

*** This bug has been marked as a duplicate of bug 2229810 ***