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

Harbor Token Expiration (Minutes) setting #21656

Open
ep4sh opened this issue Feb 20, 2025 · 4 comments
Open

Harbor Token Expiration (Minutes) setting #21656

ep4sh opened this issue Feb 20, 2025 · 4 comments

Comments

@ep4sh
Copy link

ep4sh commented Feb 20, 2025

Dear community,
could you please explain some features regarding token lifetime with OIDC.

I use OIDC (keycloak) and harbor (works perfectly, btw).

My token expiration is 360min, but it looks like the token is being expired earlier than the desired timeframe.
I guess it could depend on OIDC parameter like refresh token, isn't it?

Image

thanks in advance,
P.

@wy65701436
Copy link
Contributor

the token expiration is for the distribution v2 api token to pull artifacts, and the second session timeout is for the harbor UI session timeout.

Can you explain the issue that you have in details?

@ep4sh
Copy link
Author

ep4sh commented Feb 24, 2025

Sure, as you can see, I set up 360 minutes for token expiration, unfortunately, I'm getting unauthorized error for docker CLI (approximately) every 50–60 minutes. Then I have to open harbor UI, logout, login with Keycloak, exec docker login.

I just want to perform those operations once a day (let's say once in 360m).

If you're curious about versions:

  • harbor v2.12.2
  • Docker version 27.5.1, build 9f9e405801

Thanks!

@fangzhengjin
Copy link

same problem

ep4sh added a commit to ep4sh/harbor that referenced this issue Feb 26, 2025
Signed-off-by: Pasha Radchenko <ep4sh2k@gmail.com>
@ep4sh
Copy link
Author

ep4sh commented Feb 26, 2025

My guess is that when the token is being created here (from user config):

So the default config (DefaultMgr) was used. I've also created a draft PR for it, please check.

Thanks, P.

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