Skip to content

adk_request_credential: Bearer Token Example #2093

@patrick-hertling

Description

@patrick-hertling

Bearer Token Example:
I couldn't find how to do this anywhere.

Usecase:
Agent with OpenApiToolset
API uses JWT in HTTP header like Authentication: Bearer eJasdfasdfadsf...
Token expires every hour

When Agent answers with adk_request_credential event, what am I supposed to give him exactly?

This is what I have tried:

POST /run

{
  "appName": "api_agent",
  "userId": "u_123",
  "sessionId": "s_125",
  "newMessage": {
    "role": "user",
    "parts": [
      {
        "function_response": {
          "id": "adk-22bf4fc3-b66c-401d-8d63-a12282672f12",
          "name": "adk_request_credential",
          "response": {
            "authScheme": {
              "type": "http",
              "scheme": "bearer",
              "bearerFormat": "JWT"
            },
            "credentialKey": "adk_http_3406774919278891756_",
            "authCredentials": {
              "type": "http",
              "http": {
                "scheme": "bearer",
                "credentials": {
                  "token": "token goes here"
                }
              }
            }
          }
        }
      }
    ]
  }
}

We can never get the agent to continue the flow.
He always response that he does not have the credentials.

Can you help us?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions