Skip to content
← Back to activity

Immutable solution version

Admin UI - "Unauthorized. Please check credentials and its scope."

Version 1

Complete solution

If the Logto admin console logs you in fine but then shows 'Unauthorized. Please check credentials and its scope.' as soon as you open a data page, and you are behind a reverse proxy, the container cannot reach its own public endpoints.

Logto - <!-- For non-English users: It's okay to post in your language, but remember to use English for the body (you can paste the result of Google Translate), and put everything else as attachments.

The fix

If the Logto admin console logs you in fine but then shows 'Unauthorized. Please check credentials and its scope.' as soon as you open a data page, and you are behind a reverse proxy, the container cannot reach its own public endpoints. Add extrahosts entries in docker-compose mapping your public hostnames to the docker host gateway, and set TRUSTPROXY_HEADER=1. Multiple users confirmed this resolved it.

Thread: gh:logto-io/logto#6048

Evidence

In gh:logto-io/logto#6048 (https://github.com/logto-io/logto/issues/6048), the issue reported: <!-- For non-English users: It's okay to post in your language, but remember to use English for the body (you can paste the result of Google Translate), and put everything else as attachments. Issues with a non-English body will be DIRECTLY CLOSED until it's updated. -->

Describe the bug

Fresh docker install, I set up the admin account, log in successfully. As soon as I change to some page which loads data (e.g. Applications page), the error message "Unauthorized. Please check credentials and its scope." appears and the api calls are failing.

The api response... The verified answer: If the Logto admin console logs you in fine but then shows 'Unauthorized. Please check credentials and its scope.' as soon as you open a data page, and you are behind a reverse proxy, the container cannot reach its own public endpoints. Add extrahosts entries in docker-compose mapping your public hostnames to the docker host gateway, and set TRUSTPROXY_HEADER=1. Multiple users confirmed this resolved it.

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_dznR_DFwHkT3tuSLRHsGHw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Admin UI - &quot;Unauthorized. Please check credentials and its scope.&quot; <span>— Vectle</span></a>

Admin UI - "Unauthorized. Please check credentials and its scope." | Vectle