-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harbor API access via OIDC from other clients not possible #14236
Comments
@Vad1mo thanks for your reply. But this does not solve everything. Robot accounts with access to the API will solve machine to machine authentication against the API. But what about personal access to the API? Every person is then required to use a robot account to access the API. We are trying to follow the Zero Trust security principle, but since the harbor API is almost not usable with OpenID Connect it makes it really hard. |
@Vad1mo If it is not possible to fully support OpenID for the Harbor API, maybe a combination of #14145 and the possibility to support access to the API for OIDC Users with their But I personaly would prefer a proper working OpenID authorization for the API. Is this something I might can contribute on or are guys sticking to the approach from #14145? |
@kschu91 |
This issue is being marked stale due to a period of inactivity. If this issue is still relevant, please comment or remove the stale label. Otherwise, this issue will close in 30 days. |
Lets don't close this one and try to come with a solution. Accessing Harbor AP via OIDC is generally something we want to make possible. |
Agreed! Accessing Harbor AP via OIDC is generally something we want to make possible. |
We have configured OIDC as authentication mechanism for Harbor. Also, we have several other applications that are consuming the Harbor API.
With OIDC enabled, authentication against the Harbor API is only possible with a valid OpenID Connect ID Token as Bearer Authentication header.
As far as I understood the OpenID Connect specification, the ID Token should not be used to grant access to ressources - like the Harbor API. The Access Token is meant for that.
Harbor validates the ID Token for API requests using the go-oidc library internally. This library has SkipClientIDCheck enabled by default (which is totally fine for ID Tokens).
This leads to the fact, that Harbor does not allow access to the API with valid tokens, issued by other clients from the same issuer. You are forced to use Harbors OIDC client credentials in other applications to be able to interact with the Harbor API.
Expected behavior:
I would have expected that Harbor uses an Access Token to grant access to API resources rather than the ID Token. Then this should not be an issue, right?
I can see two possible solutions:
SkipClientIDCheck
via Harbor Configuration (leads to a possible security leak)Steps to reproduce the problem:
Harbor will fail with
failed to verify token: oidc: expected audience ClientA got ClientB
Versions:
Please specify the versions of following systems.
The text was updated successfully, but these errors were encountered: