{"id":18,"date":"2019-09-17T11:00:00","date_gmt":"2019-09-17T05:30:00","guid":{"rendered":"https:\/\/opstree.com\/blog\/\/?p=18"},"modified":"2019-09-19T11:21:58","modified_gmt":"2019-09-19T05:51:58","slug":"still-using-jenkins-own-user-database-for-authentication-in-privately-hosted-jenkins-why-not-update-to-gmail-authentication","status":"publish","type":"post","link":"https:\/\/opstree.com\/blog\/2019\/09\/17\/still-using-jenkins-own-user-database-for-authentication-in-privately-hosted-jenkins-why-not-update-to-gmail-authentication\/","title":{"rendered":"Achieve SSO in Privately Hosted Jenkins"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align:left;\">\n<h1 style=\"text-align:left;\"><span style=\"font-family:Arial, Helvetica, sans-serif;\">Introduction<\/span><\/h1>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\"><span style=\"font-family:Times, Times New Roman, serif;\">Providing OAuth 2.0 user authentication directly or using Google+ Sign-in reduces your CI overhead. It also provides a trusted and secure login system that&#8217;s familiar to users, consistent across devices, and removes the burden of users having to remember another username and password.\u00a0One of the hurdles in implementing a Gmail authentication is that\u00a0G<span style=\"background-color:white;\">oogle developer console and your\u00a0 Jenkins server should be in the same network or in simple terms they can talk to each other.<\/span><\/span><\/div>\n<h2>Resources Used<\/h2>\n<\/div>\n<div dir=\"ltr\" style=\"text-align:left;\">\n<ul style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\n<li><span style=\"font-family:Times, Times New Roman, serif;\">Privately Hosted Jenkins<\/span><\/li>\n<li><span style=\"font-family:Times, Times New Roman, serif;\">Google developer console<\/span><\/li>\n<li><span style=\"font-family:Times, Times New Roman, serif;\">Ngrok<\/span><\/li>\n<\/ul>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\"><span style=\"font-family:Times, Times New Roman, serif;\">In this blog, I&#8217;m trying to explain how to integrate Gmail authentication feature in your privately hosted Jenkins server so that you get free of filling the form by the time of creating a new user.<\/span><\/div>\n<h2>Setup 1: Setup Ngrok<\/h2>\n<\/div>\n<div dir=\"ltr\" style=\"text-align:left;\">\n<div style=\"text-align:left;\"><u>NGROK<\/u><\/div>\n<div style=\"text-align:left;\"><u>\u00a0<\/u><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\"><span style=\"background-color:white;font-family:Arial, Helvetica, sans-serif;\">Ngrok is multiplatform tunneling, reverse proxy software that establishes secure tunnels from a public endpoint such as the internet to a locally running network service while capturing all traffic for detailed inspection and replay.<\/span><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\"><span style=\"font-family:Arial, Helvetica, sans-serif;\">We are using Ngrok to host our Jenkins service (running on port 8080) to public IP.<\/span><br \/><span style=\"font-family:Arial, Helvetica, sans-serif;\"><br \/><\/span><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/63a2d-how-ngrok-works.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/df17c-how-ngrok-works.png\" width=\"640\" height=\"398\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Go to google and search for Download Ngrok.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/22902-screenshot2b2019-03-212bat2b4.07.052bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/76018-screenshot2b2019-03-212bat2b4.07.052bpm.png\" width=\"640\" height=\"448\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Either Login with google account or do Ngrok own signup.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/71734-screenshot2b2019-03-212bat2b4.07.512bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/2517e-screenshot2b2019-03-212bat2b4.07.512bpm.png\" width=\"550\" height=\"640\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;\"><span style=\"font-family:Times, Times New Roman, serif;\">After Logged in Ngrok Download it.<\/span><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/3a57d-screenshot2b2019-03-212bat2b4.10.422bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/7b9c2-screenshot2b2019-03-212bat2b4.10.422bpm.png\" width=\"640\" height=\"424\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After Download Ngrok, Go to the console and unzip the downloaded zip file and then move it to \/usr\/local\/bin.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Note: Moving part is optional, we do so for accessing ngrok from anywhere.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/72bee-screenshot2b2019-03-212bat2b4.15.092bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/0e338-screenshot2b2019-03-212bat2b4.15.092bpm.png\" width=\"640\" height=\"140\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Go to ngrok UI page , copy the authentication key and paste it.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Note: Remove &#8221; . \/ &#8221; sign because we moved ngrok file to \/usr\/local\/bin<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/7e820-screenshot2b2019-03-212bat2b4.16.012bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/68bd3-screenshot2b2019-03-212bat2b4.16.012bpm.png\" width=\"640\" height=\"48\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0Major configuration for Ngrok is done. Now type the command:<\/div>\n<pre>ngrok http 8080<\/pre>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0Assuming that Jenkins is running on port 8080.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/6503b-screenshot2b2019-03-212bat2b12.35.532bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/d6f09-screenshot2b2019-03-212bat2b12.35.532bpm.png\" width=\"640\" height=\"166\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Now Ngrok Host our Jenkins Service to public IP.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/fca2c-screenshot2b2019-03-212bat2b12.37.502bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/3263a-screenshot2b2019-03-212bat2b12.37.502bpm.png\" width=\"640\" height=\"214\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Copy this IP, we will use it in the google developer console.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Note: Make this terminal up and running.(don&#8217;t do ctrl+c)<\/div>\n<h2>Step 2: Setup Google Developer Console<\/h2>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Go to google and search for google developer console.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/07953-screenshot2b2019-03-212bat2b3.31.582bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/0715c-screenshot2b2019-03-212bat2b3.31.582bpm.png\" width=\"640\" height=\"468\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After sign in into google developer console, we will redirect to Google developer console UI screen.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Go to Select a project\u00a0 \u2192 New Project<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/0e208-screenshot2b2019-03-212bat2b12.30.082bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/0a7ed-screenshot2b2019-03-212bat2b12.30.082bpm.png\" width=\"640\" height=\"134\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/6842f-screenshot2b2019-03-212bat2b12.32.552bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/b914b-screenshot2b2019-03-212bat2b12.32.552bpm.png\" width=\"640\" height=\"318\" border=\"0\" \/><\/a><\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Give Project Name, here I will use &#8220;JenkinsGmailAuthentication&#8221; and create a project. Creating a project takes 1 or 2 minutes.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/f2b07-screenshot2b2019-03-212bat2b12.33.562bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/09175-screenshot2b2019-03-212bat2b12.33.562bpm.png\" width=\"640\" height=\"528\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After Project created, we will be redirected to the UI page as shown below. Now click on on the &#8220;Credentials&#8221; Tab on the left slide bar.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/b028c-screenshot2b2019-03-212bat2b12.34.532bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/12d3f-screenshot2b2019-03-212bat2b12.34.532bpm.png\" width=\"640\" height=\"238\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After Go to the OAuth consent screen tab and give the below entries. Here I will give Application name to &#8220;JenkinsGmailAuthentication&#8221;.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/b8659-screenshot2b2019-03-212bat2b12.39.422bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/88612-screenshot2b2019-03-212bat2b12.39.422bpm.png\" width=\"640\" height=\"492\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">The important part of the Google developer console is Public IP we created using Ngrok. Copy Public IP in Authorized domains and note to remove &#8221; http:\/\/ &#8221; in Authorized domains.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/72922-screenshot2b2019-03-212bat2b12.42.082bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/d937d-screenshot2b2019-03-212bat2b12.42.082bpm.png\" width=\"640\" height=\"424\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After Setting OAuth consent screen, Go to\u00a0 \u00a0&#8220;Credentials Tab&#8221;\u2192 Create Credentials\u2192OAuthClientID<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/9d26e-screenshot2b2019-03-212bat2b12.42.502bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/749a0-screenshot2b2019-03-212bat2b12.42.502bpm.png\" width=\"640\" height=\"386\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Select Application type as Web Application, give the name &#8220;JenkinsGmailAuthentication&#8221;.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Major Part of Create Credential has Authorized JavaScript origins and Authorized redirect URIs.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/c18fb-screenshot2b2019-03-212bat2b12.44.532bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/ae143-screenshot2b2019-03-212bat2b12.44.532bpm.png\" width=\"640\" height=\"616\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Copy Client ID and Client Secret because we are going to use these in Jenkins.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/7a546-screenshot2b2019-03-212bat2b12.45.092bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/dc30f-screenshot2b2019-03-212bat2b12.45.092bpm.png\" width=\"640\" height=\"380\" border=\"0\" \/><\/a><\/div>\n<h2>Step 3: Setup Jenkins<\/h2>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">I am assuming that Jenkins is already installed in your system.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Go to Manage Jenkins \u2192 Manage Plugins\u2192 Available<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/432ed-screenshot2b2019-03-212bat2b12.53.342bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/015bf-screenshot2b2019-03-212bat2b12.53.342bpm.png\" width=\"640\" height=\"396\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Search for &#8220;Google Login Plugin&#8221; and add it.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/a2eee-screenshot2b2019-03-212bat2b12.54.112bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/e04e3-screenshot2b2019-03-212bat2b12.54.112bpm.png\" width=\"640\" height=\"54\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Go to Manage Jenkins \u2192 Configure Global Security<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/f1935-screenshot2b2019-03-212bat2b12.52.572bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/4e3a3-screenshot2b2019-03-212bat2b12.52.572bpm.png\" width=\"640\" height=\"382\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">The major part of Jenkins Setup is to Configure Global Security.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Check the Enable security \u2192 Login with Google and Paste the Client ID and Client secret generated in Create Credential Step and Save.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/1b58b-screenshot2b2019-03-212bat2b12.56.152bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/0248b-screenshot2b2019-03-212bat2b12.56.152bpm.png\" width=\"640\" height=\"385\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Up to here, we are done with the Setup part.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Now Click on login button on Jenkins UI, you will redirect to Gmail for login.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/a4056-screenshot2b2019-03-212bat2b12.56.462bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/965cf-screenshot2b2019-03-212bat2b12.56.462bpm.png\" width=\"640\" height=\"228\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Select the account from which you want to log in.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/c6e27-screenshot2b2019-03-212bat2b12.57.072bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/e3900-screenshot2b2019-03-212bat2b12.57.072bpm.png\" width=\"640\" height=\"558\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After selecting Account you will redirect to Jenkins and you are logged in as selected user.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/cdbb5-screenshot2b2019-03-212bat2b12.58.162bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/40e4a-screenshot2b2019-03-212bat2b12.58.162bpm.png\" width=\"640\" height=\"288\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">You may be facing a problem when you log in again.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Logout from the current user and login again.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/52971-screenshot2b2019-03-222bat2b10.43.492bam.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/e019c-screenshot2b2019-03-222bat2b10.43.492bam.png\" width=\"640\" height=\"156\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After redirected to Gmail select another user.<\/div>\n<div>\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">After selecting user you will be redirected to Error Page showing: HTTP ERROR 404.<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/85b00-screenshot2b2019-03-212bat2b1.32.052bpm.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/eddb5-screenshot2b2019-03-212bat2b1.32.052bpm.png\" width=\"640\" height=\"190\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Don&#8217;t worry, you have to just remove &#8220;securityRealm\/&#8221; or enter again &#8220;localhost:8080&#8221;.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/637ca-screenshot2b2019-03-222bat2b10.45.082bam.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/fcf49-screenshot2b2019-03-222bat2b10.45.082bam.png\" width=\"640\" height=\"152\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">You are logged in with the selected user.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\"><a style=\"margin-left:1em;margin-right:1em;\" href=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/1ccb7-screenshot2b2019-03-222bat2b10.58.042bam.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/opstree.com\/blog\/\/wp-content\/uploads\/2019\/06\/fcee1-screenshot2b2019-03-222bat2b10.58.042bam.png\" width=\"640\" height=\"328\" border=\"0\" \/><\/a><\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">So now you know how to do Gmail Authentication between Google developer console and Jenkins when they are not directly reachable to each other.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">Here the main bridge between both is Ngrok which host our Privately hosted Jenkins to outer internet.<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div style=\"font-family:Times;font-variant-ligatures:normal;orphans:2;widows:2;\">\u00a0<\/div>\n<div class=\"separator\" style=\"clear:both;font-family:Times;font-variant-ligatures:normal;orphans:2;text-align:center;widows:2;\">\u00a0<\/div>\n<\/div>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction Providing OAuth 2.0 user authentication directly or using Google+ Sign-in reduces your CI overhead. It also provides a trusted and secure login system that&#8217;s familiar to users, consistent across devices, and removes the burden of users having to remember another username and password.\u00a0One of the hurdles in implementing a Gmail authentication is that\u00a0Google developer &hellip; <a href=\"https:\/\/opstree.com\/blog\/2019\/09\/17\/still-using-jenkins-own-user-database-for-authentication-in-privately-hosted-jenkins-why-not-update-to-gmail-authentication\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Achieve SSO in Privately Hosted Jenkins&#8221;<\/span><\/a><\/p>\n","protected":false},"author":159459904,"featured_media":29900,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[28070474,351789],"tags":[768739299,686695795],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/opstree.com\/blog\/wp-content\/uploads\/2025\/11\/DevSecOps-1.jpg","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pfDBOm-i","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/18"}],"collection":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/users\/159459904"}],"replies":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/comments?post=18"}],"version-history":[{"count":8,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/18\/revisions"}],"predecessor-version":[{"id":4245,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/posts\/18\/revisions\/4245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media\/29900"}],"wp:attachment":[{"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/media?parent=18"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/categories?post=18"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opstree.com\/blog\/wp-json\/wp\/v2\/tags?post=18"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}