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.

1. Create new client

Login to our Panel and create a new OAuth client. You can find the client creation under the Settings -> OAuth Clents tab.

Once you created a new client you will get a Client ID and a Client Secret. Please save them somewhere securely, you will need them later.

2. 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.

3. 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.