Skip to content

Authentication

We do use a JWT token for authentication. You can use the token to authenticate against the gRPC API. Please follow the steps below to get a valid JWT token.

Create OAuth Client

Create a new OAuth Client in User Settings -> OAuth Clients. Please save the Client ID and the Client Secret. You can find the guide here.

Authorize Service Account

The created client has also a service account ID. Please authorize the service account by adding it to the project as member. Please note: This action needs to be performed by the project owner.

Create JWT Token

Now you can create a JWT token. Please use the following command to create a new token or add a Keycloak SDK to your project.

export OAUTH_CLIENT_ID="932e8426-ed3d-4594-9b87-8fed4f8afad9"
export OAUTH_CLIENT_SECRET="PGPhCQvy1fXJ9Xzet8yMMwMjGKJtY35T"

export OAUTH_TOKEN_URL="https://auth.g-portal.com/auth/realms/master/protocol/openid-connect/token"

export TOKEN=$(curl -X POST $OAUTH_TOKEN_URL \
    -d "client_id=$OAUTH_CLIENT_ID" \
    -d "client_secret=$OAUTH_CLIENT_SECRET" \
    -d 'grant_type=client_credentials' | jq -r '.access_token')

echo $TOKEN

This token can be added as a Bearer token to the Authorization metadata of the gRPC request.