Google SAML

How to use Google Workspace SAML identity provider with Kimai

Go back to general SAML configuration for Kimai.

SAML authentication with Keycloak accounts has proven to work with the following configurations.

Group sync

If you want to sync user-roles as well, you have to know that Google has two different ways to do that. You can either use Google Groups or additional user attributes. We strongly recommend to use Google Groups, but you can create an additional multi-value user attribute as well. Both are described below in the Step-by-Step guide.


Please copy & paste the entire SAML configuration. Adjust the following keys with your Google / App specific settings:

        provider: google
        activate: true
        title: Login with Google
            - { saml: $Email, kimai: email }
            - { saml: $FirstName $LastName, kimai: alias }
            - { saml: $Title, kimai: title }
            - { saml: $AccountNumber, kimai: accountNumber }
            resetOnLogin: true
            attribute: Groups
                - { saml: KIMAI ADMIN, kimai: ROLE_ADMIN }
                - { saml: KIMAI TEAMLEAD, kimai: ROLE_TEAMLEAD }
                entityId: ''
                    url: ''
                x509cert: 'ADD YOUR CERTIFICATE HERE'
            # Your Kimai: replace with your base URL
                entityId: ''
                    url: ''

You have to adjust more keys, please read the main SAML configuration!

Create and configure the SAML application

  • Go to
  • Choose “Add app” followed by “Add custom SAML app”
  • Choose your app name (e.g. “Kimai”) and add this image
  • Copy & paste the values from the Google Step-by-Step (page 2) guide into your Kimai configuration:
    • SSO-URL into Single Sign-On URL
    • Entity-ID into Entity ID
    • Certificate into X.509 Certificate
  • Configure and copy the Service Provider (kimai.saml.connection.sp) values to Google (page 3):
    • connection.sp.assertionConsumerService.url into ACS-URL
    • connection.sp.entityId into Entity-ID
    • Choose the Name-ID Format: “X509_SUBJECT”
    • Select the Name-ID: “Basic Information > Primary Email”
    • On page 4 Attributes you have to define the User attribute mapping like this (correct case is important):
    Google directory attribute App attribute
    Basic Information > Primary email Email
    Basic Information > First name FirstName
    Basic Information > Last name LastName
    Employee Details > Employee ID AccountNumber
    Employee Details > Title Title
  • Back on the overview page: activate the new application for your users
  • The last configuration step takes care of the User role mapping, which can be defined in two ways:
    • Using Google Groups (recommended):
      • Create Groups for the Kimai roles you want to apply under Directory > Groups
      • Apply these groups to your users
      • Go back to edit your SAML application and configure the optional group-membership:
        • Choose all groups you configured for Kimai and map them to the App-Attribute Groups
    • Using a custom attribute:
      • Create a User defined attribute called SAML Group
      • Add a field KimaiRole as text type with multi-value
      • Edit your users and apply the values within the new attribute:
        • The value Kimai-System maps to the Kimai role System-Admin
        • The value Kimai-Admin maps to the Kimai role Administrator
        • The value Kimai-Teamlead maps to the Kimai role Teamlead
      • Go back to edit your SAML application and configure one more attribute mapping:
        • The Google directory attribute SAML Group > KimaiRole to the App-Attribute Groups

You can use other names for your groups, the mapping happens in the next step in your Cloud configuration.

This screenshot is a showcase of the attribute mapping including groups:

SAML attribute mapping

Single Logout

Google does not support single logout, so it needs to be commented in the configuration.

The “single logout” feature was not yet tested, if you want to help, please let me know!