Reputation: 443
I am implementing a small tool with integration with GitLab as Identity Provider. React on the frontend, Quarkus on the backend.
I have configured my backend as web_app
and this part is working. After entering localhost:8080/auth
(backend) Quarkus redirects me to the GitLab, after login I am redirected back to the backend which returns UserInfo
as JSON.
Now I want to add frontend part based on sessions (cookies). According to the docs I set quarkus.oidc.authentication.java-script-auto-redirect=false
and my frontend receives 499 code and then using window.location.assign
browser opens backend -> GitLab -> login -> UserInfo
as JSON. And at the end, flow stops on the backend, and I am not able to get back to the frontend.
window.location.assign("http://localhost:8080/auth")
to hold frontend context (I need to use this, otherwise redirect to GitLab will fail with CORS)?Upvotes: 3
Views: 1500
Reputation: 443
After some research, tries and fails, implementation is ready.
Flow:
'X-Requested-With': 'JavaScript'
window.location.assign
redirects to the GitLab log-in pageBoth - frontend and backend - are working on the same domain.
Implementation - https://gitlab.com/hakkie-it/time-tracker/time-tracker
Upvotes: 4