# Feature SI-14 - Extend Nextcloud files storage to use SSO access tokens 

Project: Stream Integration Basics
Status: closed
URL: https://community.openproject.org/work_packages/SI-14

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 16.0.0 |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

| ID | Subject | Status | Decision |
| --- | --- | --- | --- |
| SI-50 | How to deal with expired refresh tokens? | decided | Hint |
| SI-57 | Should we exchange tokens lazily or eagerly? | decided | lazy |
| SI-58 | Should OAuth 2.0 SSO and Two-Way OAuth 2.0 be mutually exclusive or should SSO fall back to Two-Way? | decided | We allow configuration of both |

## Use cases

_No work packages_

## Features and Chunks

| ID | Subject | Type | Status | Assignee | Target versions | Spent time |
| --- | --- | --- | --- | --- | --- | --- |
| SI-33 | Save OIDC tokens to OpenProject database | Implementation | closed |  |  |  |
| SI-43 | Allow to perform NC authentication using stored access tokens | Implementation | closed |  |  |  |
| SI-44 | Perform Token Exchange to obtain missing token for target audience | Implementation | closed |  |  |  |
| SI-48 | Allow to discover additional audiences of a token | Implementation | closed |  |  |  |
| SI-55 | Service to get usable OIDC token for an audience | Implementation | closed |  |  |  |
| SI-62 | Update RemoteIdentity after token exchange | Implementation | closed |  |  |  |
| SI-63 | Update AMPF Sync process to account for OIDC | Implementation | closed |  |  |  |
| SI-79 | Fix UI for projects and workpackage to handle storages in IDP/NCHUB scenario | Implementation | closed |  |  |  |
| SI-82 | Make sure new authentication strategy is used everywhere | Implementation | closed |  | 15.4.0 |  |

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Feature Lead |  |
| Developers | OP Dev Titan Team |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** a user  
**I want to** use SSO once and have Nextcloud (NC) integration working right away   
**so that** there is no need for me taking the extra steps of completing OAuth2 grant flows again and again,

**Acceptance criteria**

  - User's OIDC access and refresh tokens are saved to the database, along with the audience where they can be used.

  - When storage is configured for authentication through central OIDC provider (IDP):
    
      - Nextcloud queries and commands that act on user's behalf, use access tokens issued by IDP to authenticate requests (used token must have NC as audience)
    
      - Expired access\_tokens are refreshed when expired
    
      - When no access token has the required audience, token exchange at the IDP is attempted
    
      - As a client we must behave compliant to the open standards we follow
        
          - Specifically, [OAuth 2.0](https://www.rfc-editor.org/rfc/rfc6749.html), [OAuth 2.0 Token Exchange](https://www.rfc-editor.org/rfc/rfc8693) and [OpenID Connect Core](https://openid.net/specs/openid-connect-core-1_0.html)
        
          - e.g. we should accept that an access token might be opaque and should only optionally assume it to be a JWT

  - When storage is configured for two-way OAuth 2, the authentication behaviour remains the same as before.
