Get Kernel access token for Aura Gateway API

Guidelines to get a Kernel access token for working with aura-gateway-api

Steps in the process

  • To use the Kernel aura-aiservice API, first authenticate with the client credentials specifying the required scopes, that depend on the specific ATRIA capability to be used:

    • NLP as a Service: aura-ai-services:nlp-messaging:write
    • Generative AI and RAG: aura-ai-services:messaging:write
  • Afterwards, refresh the token following Kernel instructions.

  • To obtain the real secret of your app, just run the following command, as an example of using the app “aura-bot” in Kernel “global-int-current” with a fake password.

    $ kubectl -n $AURA_ENVIRONMENT get secret aura-bot -o json | jq -r ".data.AURA_FP_CLIENT_SECRET|@base64d"
    
  • Now you can request the access_token:

    # generate a valid UUID as correlator
    # substitute {{correlator}} with the generated UUID
    export CORRELATOR={{correlator}}
    # substitute aura-bot:secret with the specific information for your Kernel client.
    
    $ curl -i -X POST -u aura-bot:secret -H 'Content-Type: application/x-www-form-urlencoded' -H 'Cache-Control: no-cache' -H 'x-correlator: $CORRELATOR' 'https://auth.global-int-current.baikalplatform.com/token' -d 'scope=aura-ai-services:messaging:write&grant_type=client_credentials'
    
    HTTP/2 200
    {"access_token":"<token>","token_type":"Bearer","expires_in":3599,"scope":"aura-ai-services:messaging:write","purpose":""}
    

This token expires after a certain time, so it is required to repeat the steps above to obtain a new one.

Access here to more information about Kernel authentication.