RPC Security Workshop
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # "Identity Chaining" ## Introduction Since the introduction of the [OAuth 2.0 Authorization Framework (RFC6749)](https://datatracker.ietf.org/doc/html/rfc6749) in 2012 it has found brought adoption in the industry and is still popular today. Whilst clients, resource servers, resources and the authorization server are all part of one domain, developers are often faced with the situation that a protected resource is located in a domain and thus protected by a different authorization server. A request can even take multiple hops across various domains until it finds its destination at a resource. All protected resources along the way are challenged to correctly authorizing the end user and require its claims from the previous trust domains to achieve that. This problem is further described as **Identity Chaining** ![](https://hackmd.io/_uploads/ryjuA8kv2.png) Figure 1: Identity Chaining. Figure 1 draws a simple scenario of Identity Chaining. The **User** accesses a protected resource located at **Resource Server A**. The access is determined via **Authorization Server A**. Resource Server A itself needs to access protected resource located at **Resource Server B** in "Domain B" which is protected by **Authorization Server B**. ## Use cases A few use cases are described below to help clarify the various scenarios the authors see and this specification targets to solve. ### Preserve identity across trust boundaries To be added. ### Scenario for resilience flow To be added. ### Scenario for governance flow To be added. ## Identity Chaining Flow To achieve Identity Chaining the authors of this specification propose a combination of [Token Exchange (RFC8393)]() and a profile of the [Assertion Framework for OAuth 2.0 Client Authentication and Authorization Grants](). The authors are convinced that leveraging existing specifications reduces complexity and drives quick adoption. The abstract flow outlined below describes how these specification are used and work together. 2 profiles are later described in this specification targeting different requirements: - Resilience oriented profile - Governance oriented profile Further profiles may be developed but adhering the abstract Identity Chaining flow is highly reccomended. ### Roles **Client** The entity that performs Identity Chaining is in this specification referred as the Client. Based on the 2 profiles below the client may either be a Resource Server or an Authorization Aerver. **Authorization Server A and Resource Server A** Authorization Server and Resource Server of Domain A. Resource Server A requires access to a protected resource located at Domain B. **Authorization Server B and Resource Server B** Authorization Server and Resource Server of Domain B. Resource Server B hosts the protected resource Domain A requires. ### Abstract Flow The flow in figure 2 describes the steps necessary to receive an access token for the protected resource a at Resource Server B in Domain B. The steps are described in detail below. ![](https://hackmd.io/_uploads/Sk050Lkv3.png) *Figure 2: Abstract Identity Chaining flow* ### **(A) Discovering Authorization Server B** The first step is the discovery of the Authorization Server B. This specification does not cover the details of such. The client MAY contact the resource and leverage the WWW-Authentication response (see [RFC 6750 Section 3](https://datatracker.ietf.org/doc/html/rfc6750#section-3)), maintain a static mapping or use other means to identify Authorization Server B. ### **(B+C) Token Exchange** Once the Authorization Server B is identified the client performs an [RFC 8693 Token Exchange](https://datatracker.ietf.org/doc/html/rfc8693) to its own Authorization Server A. This steps is used to receive a Authorization Grant as specified in [RFC 6749 Section 1.3](https://datatracker.ietf.org/doc/html/rfc6749#section-1.3) and [RFC 7523 Section 2.1](https://datatracker.ietf.org/doc/html/rfc7523#section-2.1) dedicated for Authorization Server B. The token exchange allows the following: - Authorization Server A has control over trust boundary federations. It MAY deny the request if federation to trust boundary B is not allowed. - Authorization Server A can control what claims are disclosed to Authorization Server B. It may remove claims not designated to be seen outside of trust boundary. It also may hide claims (e.g. by producing a [SD-JWT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-selective-disclosure-jwt-04)) for privacy or other reasons. - Authorization Server A MAY add additional claims. This can be necessary for Authorization Server B to correctly identify the subject. It may know the identity under a different identifier and Authorization Server A maintains that mapping. - Authorization Server B may require a specific authorization grant format. This specification does not specify or restrict certain formats and choosen format is subject to support and security requirements of both Authorization Servers. It is reccomended for both Authorization Servers to negociate a contract of authorization grant format and containing claims. Authorization Grants are subject to the implementation and MAY be JWT tokens [see RFC 7523 Section 3](https://datatracker.ietf.org/doc/html/rfc7523#section-3), encrypted JWE tokens [see RFC 7516](https://datatracker.ietf.org/doc/html/rfc7516) or something entire differently. The parameters described in [Token Exchange]() apply here with the following restrictions: ||| |---------------|-------| | subject_token | REQUIRED Access token of the subject that will be used to call protected resource X in trust boundary B | | requested_token_type | OPTIONAL according to [RFC8693 Section 2.1](https://datatracker.ietf.org/doc/html/rfc8693#name-request). This specification, however, reccomends that clients SHOULD NOT specify this to allow the Authorization Server to returns an Authorization Grant based on the targeted Authorization Server and not tightly couple clients to the format. | | resource | OPTIONAL. URI of Authorization Server B. REQUIRED if audience is not set. | | audience | OPTIONAL. Well known/logical name of Authorization Server B. REQUIRED if resource is not set. | | scope | OPTIONAL additional scopes to indicate scopes included in returned authorization grant | #### Requirement of resource or audience Either one of resource or audience is required to indicate the Authorization Server what other Authorization Server is targeted. The request MUST deny the request if neither is set. A Authorization SHOULD deny the request on an unknown resource/audience. In cases where federation to any authorization server is deliberate this MAY be allowed. #### Using scope to control claim exposure Client and Authorization Servers MAY use the scope parameter to control transcribed claims and thus the claims exposed to trust boundary B. Authorization Servers SHOULD verify that requested scopes are not higher priveleged than the scopes of presented subject_token. #### Response The token exchange response aligns with [Token Exchange section 2.2](https://datatracker.ietf.org/doc/html/rfc8693#name-response). The returned authorization grant format is subject to the requested audience/resource (authorization server) and clients SHOULD NOT rely on the format and consider the authorization grant as a whole. This allows flexibility on the contract of claims and format between Authorization Server A and B. Returned Authorization Grant MUST be audienced to Authorization Servers. This corresponds with [RFC 7523 Section 3, Point 3](https://datatracker.ietf.org/doc/html/rfc7523#section-3) and is there to reduce missuse and to prevent clients from presenting their (for other use cases intented) access tokens as asseration. Response authorization grant MAY be audienced to multiple Authorization Servers if federation happens to multiple trust boundaries. The authors of this specification reccomended that only one audience is used to prevent Authorization Server B to abuse and present the token to Authorization Server C. #### Example grant_type=urn:ietf:params:oauth:grant-type:token-exchange subject_token=<access token of the end-user (in a 3 legged flow) or the requesting resource server (in a 2 legged flow)> subject_token_type=urn:ietf:params:oauth:token-type:access_token actor_token=<access token of the requesting resource server> actor_token_type=urn:ietf:params:oauth:token-type:access_token resource=<URL of Authorization Server B> ### (D+E) Authorization Grant Flow The client uses the received Authorization Grant from steps B and C as an asseration towards Authorization Server B. #### Request Everything in [RFC 7521](https://www.rfc-editor.org/rfc/rfc7521) ([Section 4.1](https://www.rfc-editor.org/rfc/rfc7521#section-4.1) in specific) and [RFC 7523](https://www.rfc-editor.org/rfc/rfc7523) applies. For the purpose of this specification the following descriptions apply: ||| |----|-----| | grant_type | REQUIRED. In case of an JWT Bearer Grant this would be `urn:ietf:params:oauth:grant-type:jwt-bearer`. A different URN may be used in case of a different format. | | asseration | REQUIRED. Authorization Grant received from Authorization Server A | | scope | OPTIONAL. No changes. | TODO: How do we incidate the resource? #### Processing rules All of [Section 5.2 in RFC 7521](https://www.rfc-editor.org/rfc/rfc7521#section-5.2) applies. For the purpose of this specification the following concrete descriptions apply: ||| |--|--| | Issuer | The issuer MUST be the Authorization Server A that issued the authorization grant. | | Audience | MUST be Authorization Server B | #### Response Authorization Server B returns an access token for Resource Server B. #### Example ``` grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer assertion=<resulting authorization grant from token exchange> ``` ## Profiles ### Resilience Profile **In this profile Resource Server A acts as the client of the Identity Chaining flow** ![](https://hackmd.io/_uploads/HJjC08Jvn.png) This profiles MAY be used when: - Authorization Server B is reachable by Resource Server A by network and possesses the appropiate client authentication (if required by Authorization Server B). - Resource Server A has the ability to determine the Authorization Server of Resource B (Authorization Server B). In some cases additional context only the requestor possesses is required to determine the correct Authorization Server. For example when the resource URI accepts access token of multiple issuers. Steps: (A) The client accesses a resource within its domain (Resource Server A). The resource recognises that it requires to access a resource in a different domain (Resource Server B). (abstract_A) Resource Server A determines the Authorization Server of P B (Authorization Server B). (abstract_B) Resource Server A performs a token exchange to Authorization Server A. See abstract for details. (abstract_C) Authorization Server A allows the access to resource in the different domain (Resource B) and returns an issued token audienced to Authorization Server B. (abstract_D) Resource Server A uses this token to perform a bearer flow at Authorization Server B. See abstract for details. (abstract_E) Authorization Server B performs its checks, transribes claims and returns an access token for Resource Server B. (B) Resource Server A uses this access token to access Resource Server B. ### Governance Profile **In this profile Authorization Server A acts as the client of the Identity Chaining flow** ![](https://hackmd.io/_uploads/S1hb1vyDn.png) This profile focuses on governance and MAY be picked if either of the following is true: - Resource Server must not have knowledge of Authorization Server B. - Resource Server does not have network access to Authorization Server B - Authorization Server A requires strict control on resources (or resources outside of domain) accessed. - Authorization Server B requires client authentication and managing clients for Resource Servers of Trust Domain A is not wanted. Steps: (A) The client accesses a resource within its domain (Resource A). The resource recognises that it requires to access a resource outside of its domain (Resource B). (B) Resource A performs a token exchange (TBD, maybe separate profile) to its authorization server (Authorization Server A) to request an access token for Resource B. (abstract_A) Authorization Server A (in abstract "Client") recognises the resource and determines the correct authorization server (Authorization Server B). (abstract_B+C) Authorization Server A performs an internal token exchange to mint an authorization grant audienced to Authorization Server B. (abstract_D) Authorization Server A uses the authorization grant as an asseration towards Suthorization Server B. (abstract_E) Authorization Server B performs its checks and returns an access token for Resource Server B. (D) Authorization Server A returns received token to Resource Server A. (E) Resource Server A uses the access token to access Resource Server B.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully