Need a help on one of the requirement. We would like to chain LDAP and OATH2 authentication.
Registered 2 APIs in KONG say API-1 and API-2.
Created a LDAP plugin and associated it with the API-1.
Created a OAUTH2 auth plugin and associated it with the API-2.
Accessed API-1 with username and pwd, ldap plugin authenticated successfully and requested proxied to upstream.
However, we do not want the request to be proxied to upstream, instead once ldap authenticated, plugin needs to respond with success response to the client. Post that we would like to generate access tokens and use the tokens to access API-2 which would proxy to upstream and the flow continues.
Couple of things,
- Is there any way to skip upstream proxying after LDAP authentication and return back response to client.
- Post LDAP authentication, Is there a mechanism to use upstream url as kong endpoint which generates accesstoken. So that my LDAP authentication and accesstoken generation would be done with a single request and the access tokens can be used for further proxying.