backstage: Gitlab Authentication - Login failed; caused by PopupClosedError
📜 Description
Installed a backstage application in our on-prem Kubernetes cluster. Application is up and running. Backstage created using npx @backstage/create-app
Facing issue during the authentication setup with Gitlab. While log in UI is giving me this error : Login failed, popup was closed and Login failed, rejected by user Gitlab Version is GitLab Enterprise Edition [14.3.6-ee]
These are my settings from app-config.yaml
auth:
environment: development
providers:
gitlab:
development:
clientId: 9459************************dc7d34bb
clientSecret: a80ee1da41****************8a7fa9553f6448
## uncomment if using self-hosted GitLab
audience: https://gitlab.********.com/
## uncomment if using a custom redirect URI
callbackUrl: https://backstage-poc-*********.com/api/auth/gitlab/handler/frame?env=development
Provided all the Gitlab Scopes in the Application Setting of Gitlab UI
👍 Expected behavior
Should be able to login
👎 Actual Behavior with Screenshots
👟 Reproduction steps
- Browse the application
- Click on Sign In Option
- A new Pop up windows comes with integrated Gitlab Account authentication. Able to login successfully to Gitlab
- When on clicking Authorization getting the error
Error Screen Shot :
Since the above mentioned sign in page is in a pop up window I was not able to use Developer tools options to check the logs,
But got the logs in other way around
Accessed the application as guest user which I am able to login and tried to sign in via
Settings > Authentication Providers > Sign In
I got the following information from Developer Tools > Network :
Request URL: https://backstage-poc-**************************.com/api/auth/gitlab/refresh?optional&scope=&env=development Request Method: GET Status Code: 401
📃 Provide the context for the Bug.
No response
🖥️ Your Environment
node: v16.20.0 yarn: 1.22.19 cli: 0.22.7 (installed) backstage: 1.14.0
Dependencies: @backstage/app-defaults 1.3.1 @backstage/backend-app-api 0.4.3, 0.4.4 @backstage/backend-common 0.13.5, 0.18.5, 0.19.0 @backstage/backend-dev-utils 0.1.1 @backstage/backend-plugin-api 0.5.2, 0.5.3 @backstage/backend-tasks 0.5.2, 0.5.3 @backstage/catalog-client 1.4.1, 1.4.2 @backstage/catalog-model 1.3.0, 1.4.0 @backstage/cli-common 0.1.12 @backstage/cli-node 0.1.0 @backstage/cli 0.22.7 @backstage/config-loader 1.3.0, 1.3.1 @backstage/config 1.0.7, 1.0.8 @backstage/core-app-api 1.8.0 @backstage/core-components 0.13.1 @backstage/core-plugin-api 1.5.1 @backstage/errors 1.1.5, 1.2.0 @backstage/eslint-plugin 0.1.3 @backstage/integration-aws-node 0.1.3, 0.1.4 @backstage/integration-react 1.1.13 @backstage/integration 1.4.5, 1.5.0 @backstage/plugin-api-docs 0.9.3 @backstage/plugin-app-backend 0.3.45 @backstage/plugin-auth-backend 0.18.3 @backstage/plugin-auth-node 0.2.14, 0.2.15 @backstage/plugin-catalog-backend-module-gitlab 0.2.2 @backstage/plugin-catalog-backend 1.9.1 @backstage/plugin-catalog-common 1.0.13, 1.0.14 @backstage/plugin-catalog-graph 0.2.30 @backstage/plugin-catalog-import 0.9.8 @backstage/plugin-catalog-node 1.3.6, 1.3.7 @backstage/plugin-catalog-react 1.6.0 @backstage/plugin-catalog 1.11.0 @backstage/plugin-github-actions 0.5.18 @backstage/plugin-kubernetes-backend 0.11.0 @backstage/plugin-kubernetes-common 0.6.3 @backstage/plugin-kubernetes 0.9.1 @backstage/plugin-org 0.6.8 @backstage/plugin-permission-common 0.7.5, 0.7.6 @backstage/plugin-permission-node 0.7.8, 0.7.9 @backstage/plugin-permission-react 0.4.12 @backstage/plugin-proxy-backend 0.2.39 @backstage/plugin-scaffolder-backend 1.14.0 @backstage/plugin-scaffolder-common 1.3.0 @backstage/plugin-scaffolder-node 0.1.3 @backstage/plugin-scaffolder-react 1.4.0 @backstage/plugin-scaffolder 1.13.1 @backstage/plugin-search-backend-module-catalog 0.1.1 @backstage/plugin-search-backend-module-pg 0.5.6 @backstage/plugin-search-backend-module-techdocs 0.1.1 @backstage/plugin-search-backend-node 1.2.1 @backstage/plugin-search-backend 1.3.1 @backstage/plugin-search-common 1.2.3, 1.2.4 @backstage/plugin-search-react 1.6.0 @backstage/plugin-search 1.3.0 @backstage/plugin-tech-radar 0.6.4 @backstage/plugin-techdocs-backend 1.6.2 @backstage/plugin-techdocs-module-addons-contrib 1.0.13 @backstage/plugin-techdocs-node 1.7.1 @backstage/plugin-techdocs-react 1.1.6 @backstage/plugin-techdocs 1.6.2 @backstage/plugin-user-settings 0.7.3 @backstage/release-manifests 0.0.9 @backstage/test-utils 1.3.1 @backstage/theme 0.3.0 @backstage/types 1.0.2, 1.1.0 @backstage/version-bridge 1.0.4 Done in 1.79s.
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn’t find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
None
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (5 by maintainers)
@austinloveless-liatrio I got it to work by adding “enableExperimentalRedirectFlow: true” to the SignInPage setting. on App.tsx
I came across this issue while troubleshooting GitHub Auth locally and this article helped me tremendously. Thank you, @jamieklassen !!
If you want to avoid the self-closing popup, you can step through the auth flow manually – the
authResponsevariable might contain a more descriptive error.