Skip to content
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

Unable to Authenticate Harbor REST API with Asgardeo OIDC #21620

Open
Shehan-lakshitha opened this issue Feb 11, 2025 · 1 comment
Open

Unable to Authenticate Harbor REST API with Asgardeo OIDC #21620

Shehan-lakshitha opened this issue Feb 11, 2025 · 1 comment
Assignees

Comments

@Shehan-lakshitha
Copy link

We are developing a service to automate user management for projects using the Harbor 2.9.0 REST API. Specifically, we need to add users to projects programmatically. However, we are encountering authentication challenges when Harbor is configured with Asgardeo as the OIDC provider.

Attempts & Issues

  • Using Robot Accounts
    - Initially, we attempted to authenticate using robot accounts.
    - Unfortunately, robot accounts lack the necessary permissions to add users to projects.
    - This results in a 403 Forbidden error when attempting to perform user management operations.
  • Using ID Token from an Admin User
    - As an alternative, we followed an approach similar to API token generation when using OIDC authentication #10597 (comment), where we attempted to use the ID token obtained from an admin user.
    - However, this approach also fails, returning the following error response from the API:
{
  "errors": [
    {
      "code": "UNAUTHORIZED",
      "message": "unauthorized"
    }
  ]
}

Expected Behavior

We expect to successfully authenticate Harbor REST APIs to add users to projects.
I've seen several issues on this matter, but there is no proper workaround to fix.

@wy65701436
Copy link
Contributor

Regarding Attempt 1, you can upgrade Harbor to v2.11 or later, as these versions support assigning user management scope to a robot account.

@wy65701436 wy65701436 self-assigned this Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants