# Grafana admin authorization with Gitlab

**URL:** <https://community.grafana.com/t/grafana-admin-authorization-with-gitlab/71051>\
**Category:** Authentication\
**Created:** [August 24, 2022, 1:58pm UTC](https://community.grafana.com/t/grafana-admin-authorization-with-gitlab/71051 "2022-08-24T13:58:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeunii1](https://avatars.discourse-cdn.com/v4/letter/j/b5a626/32.png) [@jeunii1](https://community.grafana.com/u/jeunii1)\
**Post date:** [August 24, 2022, 1:58pm UTC](https://community.grafana.com/t/grafana-admin-authorization-with-gitlab/71051/1 "2022-08-24T13:58:23Z")

</div>

I am trying to authenticate and authorize users using Gitlab. On the gitlab side, Ive configured the app as such

 ![Screen Shot 2022-08-24 at 9.54.09 AM](https://us1.discourse-cdn.com/grafana/original/3X/2/1/2115ddca23da68eadb568cf67f475969c2dbd3c0.png)

On the helm chart side, my config looks like

```auto
  grafana:
    grafana.ini:
      server:
        root_url: https://grafana.company.com
      auth.gitlab:
        enabled: true
        allow_sign_up: true
        client_id: <path:prod/monitoring#GITLAB_CLIENT_ID>
        client_secret: <path:prod/monitoring#GITLAB_CLIENT_SECRET>
        scopes: read_user, read_api
        auth_url: https://gitlab.com/oauth/authorize
        token_url: https://gitlab.com/oauth/token
        api_url: https://gitlab.com/api/v4
        allowed_groups: "company/team-engineering"
        role_attribute_path: "contains(groups[*], 'company/team-engineering') && 'Admin' || 'Viewer'"

```

`company/team-engineering` is the group I am part of in gitlab.

I am able to successfully login and I can see the UI and all the dashboards but I get logged in as Viewer only. I do not have any Admin privileges.

 ![Screen Shot 2022-08-24 at 9.59.08 AM](https://us1.discourse-cdn.com/grafana/original/3X/1/c/1cda0222212a976437566fee55a288e10f15a526.png)

I though after reading [this](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/gitlab/#map-roles) that all I need to do is

```auto
role_attribute_path: "contains(groups[*], 'company/team-engineering') && 'Admin' || 'Viewer'"

```

but seems like this is not working. Am I missing something ?
