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

CORS error when logging with Microsoft #4853

Closed
krystofrezac opened this issue Jul 4, 2024 · 2 comments
Closed

CORS error when logging with Microsoft #4853

krystofrezac opened this issue Jul 4, 2024 · 2 comments

Comments

@krystofrezac
Copy link

Description

Registry
Version
: 2.6.0.Final
Persistence type: sql

When logging with Microsoft I get this error and get stuck on white screen.
Screenshot 2024-07-04 at 14 01 48

I am able to log in with this plugin enabled: https://chromewebstore.google.com/detail/cors-unblock/lfhmikememgdcahcdlaciloancbhjino

Environment

config env variables:

REGISTRY_AUTH_ANONYMOUS_READ_ACCESS_ENABLED: "true"
REGISTRY_AUTH_ENABLED: "true"
REGISTRY_UI_AUTH_TYPE: oidc
KEYCLOAK_API_CLIENT_ID: xxx
REGISTRY_OIDC_UI_CLIENT_ID: xxx
REGISTRY_AUTH_URL_CONFIGURED: https://login.microsoftonline.com/xxx
REGISTRY_OIDC_UI_REDIRECT_URL: xxx
ROLE_BASED_AUTHZ_ENABLED: "true"
QUARKUS_OIDC_ROLES_ROLE_CLAIM_PATH: roles
CORS_ALLOWED_ORIGINS: "*"

Steps to Reproduce

  1. Go to the ui
  2. Login with Microsoft
  3. Check the console

Expected vs Actual Behaviour

The expected behaviour is to login without any problem.

Possible fix

It works with this patch applied on tag 2.6.0.Final . But I am not sure if it will break some other functionality

diff --git a/ui/src/services/auth/auth.service.ts b/ui/src/services/auth/auth.service.ts
index 3446461dc..96da207cd 100644
--- a/ui/src/services/auth/auth.service.ts
+++ b/ui/src/services/auth/auth.service.ts
@@ -128,7 +128,7 @@ export class AuthService implements Service {
             response_type: "code",
             scope: "openid profile email",
             filterProtocolClaims: true,
-            loadUserInfo: true
+            // loadUserInfo: true
         };
     }
@krystofrezac krystofrezac added the type/bug Something isn't working label Jul 4, 2024
@carlesarnal
Copy link
Member

carlesarnal commented Sep 26, 2024

In this context the request is being blocked by ENTRA ID, not by Registry, it's very likely a misconfiguration there. If you follow the blog we have you must be able to log in without any problems.

@carlesarnal carlesarnal added area/rest-api and removed type/bug Something isn't working area/storage labels Sep 26, 2024
@krystofrezac
Copy link
Author

Yeah, you're right. It was misconfigured. I missed the v2.0 at the end of REGISTRY_AUTH_URL_CONFIGURED

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

2 participants