You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "darkSheep404 (via GitHub)" <gi...@apache.org> on 2023/07/28 03:30:39 UTC

[GitHub] [apisix] darkSheep404 opened a new issue, #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

darkSheep404 opened a new issue, #9922:
URL: https://github.com/apache/apisix/issues/9922

   ### Description
   
   hi apisix team:
   request background
   因为有区分内外网隔离环境
   访问外部认证服务器需要走代理从内网服务器从内网出外网
   在Springboot中需要配置代理服务器 like
   ```
   private WebClient buildByProxyClientConnector(WebClient.Builder webClientBuilder) {
       return webClientBuilder.clientConnector(getProxyReactorClientHttpConnector()).build();
     }
    HttpClient.create(proxyClientProvider())
               .proxy(
                   proxy ->
                       proxy
                           .type(ProxyProvider.Proxy.HTTP)
                           .address(
                               new InetSocketAddress(
                                   webServiceProperties.getProxyHost(),
                                   Integer.parseInt(webServiceProperties.getProxyPort())))));
   ```
   这样 使用这个Webclient的请求可以走代理服务器到外网
   
   请问apisix是否支持通过配置来实现这一功能
   
   
   
   ### Environment
   
   - APISIX version : apisix:2.12.1-alpine
   


-- 
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: notifications-unsubscribe@apisix.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655515577

   > > 你可以讲中文, 我没有非常理解你最后一个问题是什么.
   > 
   > emmm 想确认一下apisix现在还没有做正向代理 的插件是吧😂
   
   APISIX 就不是做这个用的. 包括 nginx .


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655109204

   > hi @Sn0rt can you take a look at this when you are free,many thank~
   
   NP. I am take a look now. 


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655139506

   > > hi @Sn0rt can you take a look at this when you are free,many thank~
   > 
   > NP. I am take a look now.
   > 
   > This text looks very difficult to understand. Can you draw a picture? I can't understand this code at all. I can only guess.
   hi @Sn0rt 
   emmm,
   it maybe a forward proxy issue?
   ![image](https://github.com/apache/apisix/assets/49020899/fe160d8f-dad1-4e1f-ab99-ecd439c75ad9)
   
   
   
   ```java
   public WebClient proxyWebClient(
               ReactorClientHttpConnector connector,
               RncProperties rncProperties,
               WebClient.Builder webClientBuilder) {
          
               HttpClient httpClient =
                       HttpClient.create(myproxyProvider())
                               .proxy(proxy -> proxy.type(ProxyProvider.Proxy.HTTP)
                                       .host(myProxyProperties.getProxyHost())
                                       .port(Integer.parseInt(myProxyProperties.getProxyPort())));
               connector = new ReactorClientHttpConnector(httpClient);
           
           return webClientBuilder
                   .clientConnector(connector)
                   .baseUrl(rncProperties.getBaseUrl())
                   .build();
       }
   ```
   > use
   ```
   return proxyWebClient
           .post()
           .uri("/xxx")
           .bodyValue(userTrade)
           .retrieve()
           .bodyToMono(List.class)
           .block();
   ```
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655045590

   hi @Sn0rt 
   can you take a look at this when you are free,many thank~
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655185584

   
   > in short.
   > 
   > Do you want APISIX to pass a proxy when using the openid-connect plugin to access the auth service?
   
   yes,i would like to know how can i use forward prox for this plugin of a specified url


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655272140

   ok,and may i confirm that is there has a forward proxy apisix plugin now?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655158605

   How can you see in this picture that APISIX takes over the user's authentication request?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 closed issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 closed issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect
URL: https://github.com/apache/apisix/issues/9922


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655250643

   > > > in short.
   > > > Do you want APISIX to pass a proxy when using the openid-connect plugin to access the auth service?
   > > 
   > > 
   > > yes, i would like to know how can i use forward proxy in apisix for this plugin of a specified url
   > 
   > Currently it is not supported to use proxy when using openid-connect.
   > 
   > ![image](https://user-images.githubusercontent.com/2706161/256755599-506524e7-5379-4327-9e8c-b0e8f4ddc99e.png)
   > 
   > That is the fourth stage in the picture
   > 
   > If you want to do it, we are also very welcome, and I can provide necessary help.
   
   i wish i could find solutions to deal it  
   thanks for your help again 😀


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655196359

   > > in short.
   > > Do you want APISIX to pass a proxy when using the openid-connect plugin to access the auth service?
   > 
   > yes, i would like to know how can i use forward proxy in apisix for this plugin of a specified url
   
   Currently it is not supported to use proxy when using openid-connect.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655381776

   > > > ok,and may i confirm that is there has a forward proxy apisix plugin now?
   > > 
   > > 
   > > I don't quite understand your question.
   > 
   > Because our goal is ==> access oauth2 server in another network (外网) during openid-connect work flow So, if there is a forward proxy apisix plugin which cann let apisix access specified url using http proxy sever I think it will do helps to this goal too.
   > 
   > So I want to know if there is already a plugin that allows apisix to access a url via the forward proxy server
   
   hi @Sn0rt 
   So there isn't such a apisx forwad proxy code plugin yet?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655458985

   你可以讲中文, 我没有非常理解你最后一个问题是什么.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655529998

   是的 
   我在之前的issue讨论里也有看到过这样的结论
   NGINX最常见使用的代理是反向代理
   
   不过作为网关来说
   有的时候也会有像这种 
   需要走代理服务器出外网访问其他服务的需求
   
   不过 插件化的优势 就是能在主业外添加各种各样
   的能力
   
   那看来现在应该还没有这样的插件😃
   再次感谢您的帮助~
   
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655180162

   > > How can you see in this picture that APISIX takes over the user's authentication request?
   > 
   > well, it is my error. we just use apisix plugin openid-connect to process authentication with oauth2 server
   > 
   > ```yaml
   >   - uri: /api/sso/*
   >     service_id: my-admin
   >     plugins:
   >       openid-connect:
   >         client_id: apisix
   >         client_secret: xxx
   >         discovery: https://xxx.com/auth/realms/xxx-xxx/.well-known/openid-configuration
   >         scope: openid
   >         bearer_only: false
   >         realm: xxx-xxx
   >         redirect_uri: /api/sso/callback
   >         logout_path: /api/sso/logout
   >         introspection_endpoint_auth_method: client_secret_post
   >         post_logout_redirect_uri: xxx.com
   >         set_access_token_header: false
   >         set_id_token_header: false
   >  
   > ```
   > 
   > and i did't put this flow in picture here is the flow pictue in openid-connect docs https://apisix.apache.org/docs/apisix/plugins/openid-connect/
   > 
   > ![image](https://user-images.githubusercontent.com/49020899/256750668-ed1e76c2-8e70-457c-870e-e47812c04b58.png)
   
   in short.
   
   Do you want APISIX to pass a proxy when using the openid-connect plugin to access the auth service?


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655255753

   ok. can you close this issues ? 


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655168026

   > How can you see in this picture that APISIX takes over the user's authentication request?
   
   well, it is my error. 
   we just use apisix plugin openid-connect  to process authentication with oauth2 server
   and i did't put this flow in picture
   here is the flow pictue in openid-connect docs 
   https://apisix.apache.org/docs/apisix/plugins/openid-connect/
   
   ![image](https://github.com/apache/apisix/assets/49020899/ed1e76c2-8e70-457c-870e-e47812c04b58)
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] Sn0rt commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "Sn0rt (via GitHub)" <gi...@apache.org>.
Sn0rt commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655280239

   > ok,and may i confirm that is there has a forward proxy apisix plugin now?
   
   I don't quite understand your question.


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655319612

   > > ok,and may i confirm that is there has a forward proxy apisix plugin now?
   > 
   > I don't quite understand your question.
   
   Because our goal is  ==>  access oauth2 server in another network (外网) during openid-connect work flow
   So, if there is a forward proxy apisix plugin which cann let apisix access specified url using http proxy sever
   I think it will do helps to this goal  too.
   
   So I want to know if there is already a plugin that allows apisix to access a url via the forward proxy server
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655327893

   Finally, for bros who may encounter this problem in the future too
   
   I tried another solution
   
   Configure discovery url in openid-connect  a new url instead of oauth2 server
   
   Let springboot handle the url to forward the request and response using webclient/restTemplate with forward http proxy
   


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] darkSheep404 commented on issue #9922: help request: how to config proxy server for apisix to process oauth2 via openid-connect

Posted by "darkSheep404 (via GitHub)" <gi...@apache.org>.
darkSheep404 commented on issue #9922:
URL: https://github.com/apache/apisix/issues/9922#issuecomment-1655484459

   > 你可以讲中文, 我没有非常理解你最后一个问题是什么.
   
   emmm 想确认一下apisix现在还没做有正向代理费
   的插件是吧😂


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org