Skip to content

Add subject field to Authorization Server #3343

@njlie

Description

@njlie
Contributor

The Authorization Server should support subject fields in the grant request. It should be similar to the accesses in that a separate table manages each grant's subject fields.

  • Add subjects table to AS database
    • Has many-to-one relation with grants table
    • Columns should include sub_id and sub_id_format (each subject item in the request would create a separate row in the subjects)
  • Add logic in grant request endpoint to create associated subjects rows
    Add logic in token introspection route handler to return the subjects access control for the associated grant in the response.
  • Add subjects field in /grant/{id}/{nonce}response
    • Add subjects to OpenAPI spec for IDP

Prerequisites:

Activity

mkurapov

mkurapov commented on Mar 14, 2025

@mkurapov
Contributor

Should we store each subject item (sub_id sub_id_format) in a separate row? (ie to not store a list as a column)

njlie

njlie commented on Mar 14, 2025

@njlie
ContributorAuthor

Should we store each subject item (sub_id sub_id_format) in a separate row? (ie to not store a list as a column)

I'm cool with that - I originally envisioned this as being parallel to how an access row has a column for all the accesses for a given grant, but with subject ids I can see separate rows making sense as they're not as interchangeable as access actions.

moved this from Backlog to Todo in Rafikion Mar 25, 2025
linked a pull request that will close this issue on May 27, 2025
njlie

njlie commented on May 27, 2025

@njlie
ContributorAuthor

@mkurapov So in responding to @cozminu's questions about the subject field in the Grant Continuation response, I notice that subject is not a field that is supported in the token introspection response (see https://datatracker.ietf.org/doc/html/rfc9767#section-5.5.2).

As I understand it, the subject field's value is during the interaction, where the IDP acquires the requested subject information in the /grant/{id}/{nonce}response and verifies that the resource owner performing the interaction owns the wallet address in the requested subject information field. So it's not necessary for subject to be returned in the introspection response.

If we insist on returning the requested subject in the token introspection response, it would have to be part of an opinionated stance on GNAP. Thoughts on keeping subject in the token introspection response? Personally I think we don't need to - the veracity of the subject field should be communicated to the client at the time of interaction completion.

mkurapov

mkurapov commented on May 27, 2025

@mkurapov
Contributor

Agreed @njlie. If the RS does not need the subject field (especially since it is not included in the GNAP token introspection response), we shouldn't include it in the response.

cozminu

cozminu commented on May 28, 2025

@cozminu
Contributor

ok, so from my understanding the item: `Add logic in token introspection route handler to return the subjects access control for the associated grant in the response.` is not relevant

mkurapov

mkurapov commented on May 28, 2025

@mkurapov
Contributor

@cozminu that's correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Development

Participants

@cozminu@mkurapov@njlie

Issue actions

    Add `subject` field to Authorization Server · Issue #3343 · interledger/rafiki