# Bug OP-18122 - Health check for offline_access happens too late

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-18122

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / File storages, Authentication / OpenID Connect (OIDC) |
| Target versions | 17.0.0 |
| Observed in versions | 16.5.0 |
| Sprint | 17.0.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.5.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Jan Sandbrink |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Configure an OIDC provider without the `offline_access` scope

2.  Configure a Nextcloud storage that authenticates using tokens of the OIDC provider

3.  Login via the OIDC provider

4.  Wait for the expiration time of refresh tokens to pass

5.  Perform a health check of the storage configured in step 2

### What is the buggy behavior?

  - The health check correctly shows that refreshing the token failed

  - However, **no warning message is shown**, that the provider is lacking the `offline_access` scope

### What is the expected behavior?

Both, the error message and the warning message about the missing scope should be visible.

### Note

The warning message already exists. Before the refresh token expires it's visible. The problem is that the check is happening after the failed check to use the token. Thus we don't emit the warning message.

Performing the warning check earlier, would be one possible fix.
