EricGao888 commented on PR #12549:
URL: 
https://github.com/apache/dolphinscheduler/pull/12549#issuecomment-1293514424

   > Hello, I'm trying to add a new authenticator for DS to support OAuth2.0. 
Currently I'm blocked by some kind of cookie missing issue. After calling 
`http://localhost:12345/dolphinscheduler/testlogin/google`, I get successfully 
redirected to google login page and completedthe OAuth process. I could see the 
`sessionId` in browser. 
![image](https://user-images.githubusercontent.com/34905992/198209678-92d3422e-9a13-45db-a21f-df39aebc421b.png)
 However, if I try to visit 
`http://localhost:12345/dolphinscheduler/ui/projects`, the `sessionId` is 
missing and I get blocked by `LoginHandlerInterceptor`. I'm wondering whether 
it is caused by the wrong path or some other stuff related to cookie since I 
haven't implemented the front-end part of `/testlogin/google`
   > 
   > So I have two questions:
   > 
   > 1. Am I supposed to handle the cookie path in front-end part so that the 
cookie added by back-end could be sent to /ui/**?
   > 2. Since Spring Boot has its default interceptor for OAuth2.0, should I 
disabled `ds LoginHandlerInterceptor` when using OAuth2.0?
   > 
   > 
https://github.com/apache/dolphinscheduler/blob/53340fc07b1e7b6d5f76aeb015fc36eb661e4a32/dolphinscheduler-ui/src/views/login/index.tsx#L35-L52
   > 
   > Related information:
   > 
   > After authentication, ds will put `sessionId` into cookies and check the 
`sessionId` in `preHandle` method of `LoginHandlerInterceptor`, as shown below:
   > 
   > 
https://github.com/apache/dolphinscheduler/blob/53340fc07b1e7b6d5f76aeb015fc36eb661e4a32/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/security/impl/AbstractAuthenticator.java#L82-L100
   > 
   > 
https://github.com/apache/dolphinscheduler/blob/53340fc07b1e7b6d5f76aeb015fc36eb661e4a32/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/interceptor/LoginHandlerInterceptor.java#L69-L74
   > 
   > As we could see in `LoginController`, the url for login is `/login` and 
will be mapped to `/ui/login`
   > 
   > 
https://github.com/apache/dolphinscheduler/blob/53340fc07b1e7b6d5f76aeb015fc36eb661e4a32/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/LoginController.java#L83
   > 
   > But in my test code, I added a new url for login which is 
`/testlogin/google` without front-end. And it could not be mapped to 
`/ui/testlogin/google`. 
![image](https://user-images.githubusercontent.com/34905992/198208457-7799366c-3b62-41ac-8f5b-a91e60d4c8b1.png)
   > 
   > @kezhenxu94 @devosend Could u plz help take a look when available? Thanks!
   
   Questions solved, thanks for the help : ) 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to