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 cookie-secret can 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 the plugin as below and submit

  5. Now you can go to the login page to sign in with oauth2-proxy.