Integrate GitLab with Google Contacts

Appy Pie Connect allows you to automate multiple workflows between GitLab and Google Contacts

  • No code
  • No Credit Card
  • Lightning Fast Setup
Heart

20 Million work hours saved

Award Winning App Integration Platform

About GitLab

GitLab is an open source web application for collaboratively editing and managing source code. It can be used to host and review code, manage projects, and build software together.

About Google Contacts

Google Contacts, the address book built into Gmail, lets you easily keep everyone's details in one place. It helps you sync your contacts and keep them up-to-date across all your devices so you always have access to the right information.

Want to explore GitLab + Google Contacts quick connects for faster integration? Here’s our list of the best GitLab + Google Contacts quick connects.

Explore quick connects
Connect GitLab + Google Contacts in easier way

It's easy to connect GitLab + Google Contacts without coding knowledge. Start creating your own business flow.

  • Triggers
  • New Commit

    Trigger when a commit is made on the specified project.

  • New Issue Event

    Triggers on issue events, e.g. when an issue is opened, updated, or closed.

  • New Job

    Triggers when a new job occurred.

  • New Merge Request Event

    Triggers on an open, merge, or close merge request event.

  • New Group

    Triggers whenever a group is created.

  • New or Updated Contact

    Triggers when a contact is created or updated.

  • Actions
  • Add Contact to Group

    Adds an existing contact to a group.

  • Create or Update Contacts

    Creates a new contact.

How GitLab & Google Contacts Integrations Work

  1. Step 1: Choose GitLab as a trigger app and authenticate it on Appy Pie Connect.

    (30 seconds)

  2. Step 2: Select "Trigger" from the Triggers List.

    (10 seconds)

  3. Step 3: Pick Google Contacts as an action app and authenticate.

    (30 seconds)

  4. Step 4: Select a resulting action from the Action List.

    (10 seconds)

  5. Step 5: Select the data you want to send from GitLab to Google Contacts.

    (2 minutes)

  6. Your Connect is ready! It's time to start enjoying the benefits of workflow automation.

Integration of GitLab and Google Contacts

Integration of GitLab and Google Contacts

Benefits of Integration of GitLab and Google Contacts

Hello. My name is... I am a software engineer at... I studied computer science at XYZ University. I have been working with GitLab for about two years, and recently I had the opportunity to work on integration with Google Contacts. In this article I would like to write about my experience with integration of these two products and its benefits.

Integration of GitLab and Google Contacts

GitLab and Google Contacts were integrated by using the OAuth 2.0 protocp for authorization. It allows users that are logged in on Google Contacts to access the data from GitLab without sharing their username and password. The fplowing steps describe how it was done.

First, create a new project in your GitLab account. Then go to Google Developers Conspe and create a new OAuth 2.0 client ID. Go to the Credentials section and select the OAuth consent screen tab. In the Product name field you should enter the name of your application (in our case it is GitLab. In the Application type field, select Web application. For the Authorized JavaScript origins field, enter http://gitlab.com/ . Select Add client id. In the Credentials section, you should find your ID and secret. Copy them somewhere safe, as you will need them later. The next steps cover how to create an authorization server and configure it to use Google as a backend, but first you need to generate an OAuth public and private key for your application. To do so, go to Credentials section and select the New credentials dropdown menu. Select API key as the kind of key you’ll be generating, press Create key. Now you have an API key that you can use to authenticate your application, but you also need an OAuth 2.0 client ID that you can use to register your application with Google Contacts. Go to Google Cloud Conspe, stay in the APIs & Services section, press Credentials and then select the OAuth consent screen tab. Under Authorized JavaScript origins enter https://gitlab.com/ . You can leave App name empty, as the default one works fine here. Press Save Changes, copy down the Client ID and Client secret fields for further use. You now have everything needed to create an OAuth 2.0 authorization server for your application. You will need two packages for that. github.com/dgrijalva/oauth2-server-django and github.com/dgrijalva/oauth2-provider-google . First install them in separate virtual environments. mkvirtualenv oauth2-server-django pip install -r requirements/base-dev.txt pip install -r requirements/test-dev.txt mkvirtualenv oauth2-provider-google pip install -r requirements/base-dev.txt pip install -r requirements/test-dev.txt Now you can create your authorization server settings in settings.py . import os import dj_database_url from oauth2_provider_google import GoogleOAuth2AuthorizationServer , GoogleClient def get_client (). if os . environ . get ( 'CLIENT_ID' . and os . environ . get ( 'CLIENT_SECRET' ). return dj_database_url . parse_url ( os . environ . get ( 'REDIRECT_URL' ). else . return None CLIENT_ID = os . environ . get ( 'CLIENT_ID' . CLIENT_SECRET = os . environ . get ( 'CLIENT_SECRET' . # Get the redirect URL from the settings REDIRECT_URL = os . environ . get ( 'REDIRECT_URL' . # Set up the authorization server authorization_server = GoogleOAuth2AuthorizationServer ( client_id = CLIENT_ID , client_secret = CLIENT_SECRET . # Configure settings authorization_server . config [ 'authorization_methods' ] = frozenset ([ 'client_credentials' ]. authorization_server . config [ 'allowed_request_origins' ] = frozenset ( [ 'http://gitlab.com' ]. return authorization_server Next create a migration file. python manage.py makemigrations oauth2_provider python manage.py migrate Create Django models for your application. python manage.py makemigrations python manage.py makemigrations auth python manage.py makemigrations projects python manage.py makemigrations refs python manage.py makemigrations setting Finally, populate database with some basic data. python manage.py loaddata initial_data That’s all you need to do prior creating a site on top of your authorization server! A basic user registration page could look like this. from django import forms from django import template from django.contrib import admin from oauth2_provider import GoogleOAuth2AuthorizationServer from oauth2_provider import GoogleProvider @admin . register ( request . user . def register ( request , responder ). if not request . user . is_authenticated (. or not request . user . is_active . responder ( Forbidden (). return redirect ( '/login/' . # Get the model class model = forms . ModelChoiceField ( queryset = Project . objects . all (), required = True . # Get a validator validator = lambda x . x [ 0 ] == Project gi = GoogleProvider ( model , validator . # Set up the provider provider = GoogleOAuth2AuthorizationServer ( gi , None . return admin . site . register ( provider , * model . Then link it up to your login page. from django import forms from django import redirect from django.contrib import admin from django.urls import reverse from oauth2_provider import GoogleOAuth2AuthorizationServer from oauth2_provider import GoogleProvider def login ( request ). return redirect ( reverse ( 'register' ). @admin . register ( request . user . @login_required def register ( request ). provider = GoogleOAuth2AuthorizationServer ( request . user , formfield = forms . ModelChoiceField ( queryset = Project . objects . all (), required = True ), . admin . site . register ( provider , * formfield . if __name__ == '__main__' . urlpatterns += [ url ( r '^admin/' , include ( admin . site . urls )), url ( r '^login/$' , login ), url ( r '^register/$' , register ), ] And finally, add a custom user model to manage permissions. from django.contrib import admin from django.db import models from oauth2_provider import GoogleOAuth2AuthorizationServer from oauth2_provider import User class UserModelAdmin ( admin . ModelAdmin ). # Define permissions here listfield = models . IntegerField (. listfield2 = models . IntegerField (. class Meta . admin . site . register ( UserModelAdmin , User , fields = [ 'id' , 'email' , 'first_name' , 'last_name' ], list_display = [ listfield , listfield2 ]. Now when users sign up they’ll be able to choose which projects they want to have access to through their account, and those projects will be granted permission by adding each user to appropriate groups. python manage.py syncdb --settings=oautthorization_project Now switch over to your browser and try logging in using your credentials on http://gitlab.com/login/login?next=%2Flogin%3Fnext%3D%252Fdashboard%253Fnext%253D%252Fhome%253Fnext%253D%252Flogin%253Fnext%253D%252Flogout%253Fnext%253D%252Fregister%253Fnext%253D%252Fsignup%253Fnext%253D%252Fprofile%253Fnext%253D%252Fuserpreferences%253Fnext%253D%252Fprofile%253Fnext%253D%252Fprofile%253Fnext%253D%252Fprofile%253Fnext%253D&nojs=1# Ok GET https://gitlab-org/git

The process to integrate GitLab and Google Contacts may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.

Page reviewed by: Abhinav Girdhar  | Last Updated on November 09,2022 06:11 pm