OIDC Configuration
If OpenID Connect (OIDC) authentication is enabled, its details will be available through the /v1/.well-known/openid-configuration
endpoint.
If a token is configured, the endpoint redirects to it.
Usage
The discovery endpoint accepts a GET
request:
GET /v1/.well-known/openid-configuration
If there is an OIDC provider, the endpoint returns the following fields:
href
: The reference to the client.cliendID
: The ID of the client.
If there is no OIDC provider, the endpoint returns a 404
HTTP status code.
Example
- Python Client v4
- Python Client v3
- JS/TS Client (v3)
- JS/TS Client (v2)
- Go
- Java
- Curl
import weaviate
client = weaviate.connect_to_local()
open_id_configuration = client.get_open_id_configuration()
print(open_id_configuration)
finally:
client.close()
import weaviate
client = weaviate.Client("http://localhost:8080")
open_id_configuration = client.get_open_id_configuration()
print(open_id_configuration)
import weaviate from 'weaviate-client';
const client = await weaviate.connectToLocal()
const response = await client.getOpenIDConfig()
console.log(response);
import weaviate from 'weaviate-ts-client';
const client = weaviate.client({
scheme: 'http',
host: 'localhost:8080',
});
const response = await client.misc
.openidConfigurationGetter()
.do();
console.log(JSON.stringify(response, null, 2));
package main
import (
"context"
"fmt"
"github.com/weaviate/weaviate-go-client/v4/weaviate"
)
func main() {
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
}
client, err := weaviate.NewClient(cfg)
if err != nil {
panic(err)
}
openIDConfig, err := client.Misc().OpenIDConfigurationGetter().Do(context.Background())
if err != nil {
panic(err)
}
fmt.Printf("%v", openIDConfig)
}
package io.weaviate;
import io.weaviate.client.Config;
import io.weaviate.client.WeaviateClient;
import io.weaviate.client.base.Result;
import io.weaviate.client.v1.misc.model.OpenIDConfiguration;
public class App {
public static void main(String[] args) {
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
Result<OpenIDConfiguration> result = client.misc().openIDConfigGetter().run();
if (result.hasErrors()) {
System.out.println(result.getError());
return;
}
System.out.println(result.getResult());
}
}
curl http://localhost:8080/v1/.well-known/openid-configuration
If OIDC is configured, the endpoint returns a document like this:
{
"href": "http://my-token-issuer/auth/realms/my-weaviate-usecase",
"cliendID": "my-weaviate-client"
}
Questions and feedback
If you have any questions or feedback, let us know in the user forum.