Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Demo with Google and OAuth2-Proxy

Configure and

...

Start oauth2-proxy on

...

Docker

  1. Obtain Cookie Secret - Generate To generate cookie-secret can , please refer to Overview | OAuth2 Proxy (oauth2-proxy.github.io)
  2. Obtain Client ID & Client Secret - Obtain OAuth 2.0 credentials from the Google API Console https://developers.google.com/identity/protocols/oauth2#basicsteps

    docker run -p 4180:4180 quay.io/oauth2-proxy/oauth2-proxy:latest \
                 --http-address=0.0.0.0:4180 \
                 --email-domain=* \
                 --cookie-secure=false \
                  --cookie-secret=CookieSecret \
                  --upstream= http://host.docker.internal:8080/ \
                 --provider=google \    
                  --client-id=ClientID \
                  --client-secret=ClientSecret \
                 --pass-authorization-header=true \
                 --pass-access-token=true \
                  --pass-basic-auth=true


  3. After authentication from the provider (i.e. Google), oauth2-proxy

...

  1. will forward all authenticated requests to the upstream server, here is http://127.0.0.1:4180/ which will redirect to the tomcat default page so you need to modify the index.jsp in (tomcat/webapps/ROOT/index.jsp) to turn it to the plugin web service in order to do the login. Replace the page with

    Code Block
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
    <html>
    <head>
        <title>JSP Redirect</title>
        </head>
        <body>
           <%
              String redirectURL = "http://127.0.0.1:4180/jw/web/json/plugin/org.joget.plugin.marketplace.JsonWebTokenDirectoryManager/service";
              response.sendRedirect(redirectURL);
            %>
        </body>
    </html>
  2. Start Joget Tomcat.
  3. After JOGET started, import the plugin then go to Directory Manager Settings and select the plugin `JSON Web Token Directory Manager - 7.0.0`
  4. Configured Configure the plugin as below and submit. Remember to turn on the debug mode for troubleshooting purposes.

  5. Now you can go to the login page to sign in with oauth2-proxy by navigating to http://localhost:4180/jw, and click on Sign in with Google.