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

Disable CSRF check for "/c/oidc/onboard" API for authenticating and Onboarding a User via API from Custom CLI #16966

Closed
Rajpratik71 opened this issue Jun 9, 2022 · 6 comments
Labels

Comments

@Rajpratik71
Copy link

We are facing an issue when we are trying to onboard the OIDC user in the harbor via API.

https://goharbor.io/docs/edge/administration/configure-authentication/oidc-auth/

Via UI it works perfectly fine.

The same functionality is not working via the API. Getting CSRF error.

As per online research CSRF is only checked when you do activity via browser i.e. where there is some sessions.

Issue is only with this particular API. Other APIs are working fine.

Without onboarding an OIDC user we won’t be able to set secret and therefore docker login will not work.

curl -X 'POST' 'https://xxxx-registry-xxxx-xxx.xxxxxx.com/c/oidc/onboard' \ -H 'Content-Type: application/json' \ -H 'Authorization: Basic YWRtaW46cXNlYSvhcnRpZmFjdG9yeS1hZG1pbg==' \ -d '{"username": [email protected] }'

{"errors":[{"code":"FORBIDDEN","message":"CSRF token invalid"}]}

Rajpratik71 added a commit to Rajpratik71/harbor that referenced this issue Jun 9, 2022
… and Onboarding a User via API from Custom CLI



Closes goharbor#16966
Rajpratik71 added a commit to Rajpratik71/harbor that referenced this issue Jun 9, 2022
… and Onboarding a User via API from Custom CLI

Closes goharbor#16966
Fixes goharbor#16966

Signed-off-by: Pratik Raj <[email protected]>
Rajpratik71 added a commit to Rajpratik71/harbor that referenced this issue Jun 9, 2022
… and Onboarding a User via API from Custom CLI

Closes goharbor#16966
Fixes goharbor#16966

Signed-off-by: Pratik Raj <[email protected]>
@github-actions
Copy link

github-actions bot commented Aug 8, 2022

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.

@github-actions github-actions bot added the Stale label Aug 8, 2022
@Rajpratik71
Copy link
Author

Rajpratik71 commented Aug 17, 2022

@ywk253100 @wy65701436 @stonezdj @zyyw @daixiang0 @heww

can we address this issue and fix at #16969

@github-actions github-actions bot removed the Stale label Aug 18, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Oct 17, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. If this issue is still relevant, please re-open a new issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 17, 2022
@OrlinVasilev OrlinVasilev reopened this Dec 12, 2022
@github-actions github-actions bot removed the Stale label Dec 13, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Feb 12, 2023
Rajpratik71 added a commit to Rajpratik71/harbor that referenced this issue Mar 13, 2023
… and Onboarding a User via API from Custom CLI

Closes goharbor#16966
Fixes goharbor#16966

Signed-off-by: Pratik Raj <[email protected]>
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. If this issue is still relevant, please re-open a new issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment