Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'grant_types_supported' with weaviate.AuthClientCredentials #133

Closed
kendistiller opened this issue Sep 27, 2022 · 3 comments
Closed

Comments

@kendistiller
Copy link

It seems that the Python client is checking for client_credentials in the optional grant_types_supported field for the discovery response.

/weaviate/venv/lib/python3.7/site-packages/weaviate/connect/connection.py", line 201, in _set_bearer
    if 'client_credentials' not in request_third_part.json()['grant_types_supported']:
KeyError: 'grant_types_supported'

However, our OpenID Connect provider Azure AD does not provide this optional field in its discovery response (apparently).

Yet we are able to authenticate to Weaviate with OIDC via the REST API just fine (and perform read/write), so we would expect the Python client to (hopefully) behave the same.

Here is connection excerpt from the Python client:

client  = weaviate.Client(
    url='http://localhost:8080',
    auth_client_secret=weaviate.AuthClientCredentials(access_token)
)
@trengrj trengrj transferred this issue from weaviate/weaviate Oct 10, 2022
@trengrj
Copy link
Member

trengrj commented Oct 10, 2022

Hi @kendistiller, as the issue is with the python client we will transfer this issue over. We are working to provide documentation for using Weaviate with Azure AD.

@dirkkul
Copy link
Collaborator

dirkkul commented Nov 28, 2022

Hi @kendistiller ,

I think this (PR and build) will fix your issue. You have two possibilities:

  • Add the access token you got yourself
client = weaviate.Client(
        url=URL, auth_client_secret=weaviate.AuthBearerConfig(ACCESS_TOKEN)
    )
  • Let the python client get the access token
client = weaviate.Client(
        url=URL, auth_client_secret=weaviate.AuthClientCredentials(client_secret=CLIENT_SECRET, scope=SCOPE),
    )

(We have a hardcoded scope for azure. But if you supply one, yours has precedent.)

@dirkkul
Copy link
Collaborator

dirkkul commented Dec 1, 2022

merged, please let us know if this doesn't fix your error

@dirkkul dirkkul closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants