OAuth clients
OAuth clients for applications
Manage OAuth clients for applications that use Scalekit as an authorization server.
Register clients for your apps, rotate secrets carefully, and scope clients to the right application type.
CreateClient
Section titled “CreateClient”#asyncCreateClient
Runs CreateClient and returns the result.
Request context
Client.
The created resource.
import ( clients "github.com/scalekit-inc/scalekit-sdk-go/v2/pkg/grpc/scalekit/v1/clients")
created, err := scalekitClient.Client().CreateClient(ctx, &clients.CreateClient{ Name: "My Application", ClientType: "WEB_APP", PostLoginUris: []string{"https://myapp.com/callback"}, PostLogoutRedirectUris: []string{"https://myapp.com/logout"},})if err != nil { // handle}_ = created.ClientGetClient
Section titled “GetClient”#asyncGetClient
Runs GetClient and returns the result.
Request context
Client ID.
The response payload for this operation.
got, err := scalekitClient.Client().GetClient(ctx, "client_123")if err != nil { // handle}_ = got.ClientListClients
Section titled “ListClients”#asyncListClients
Runs ListClients and returns the result.
Request context
Optional request settings.
Paginated results.
clients, err := scalekitClient.Client().ListClients(ctx, &scalekit.ListClientsOptions{ PageSize: 10, PageToken: "",})if err != nil { // handle}for _, c := range clients.Clients { _ = c}UpdateClient
Section titled “UpdateClient”#asyncUpdateClient
Runs UpdateClient and returns the result.
Request context
Client ID.
Client.
Mask.
The updated resource.
import ( clients "github.com/scalekit-inc/scalekit-sdk-go/v2/pkg/grpc/scalekit/v1/clients" "google.golang.org/protobuf/types/known/fieldmaskpb")
updated, err := scalekitClient.Client().UpdateClient(ctx, "client_123", &clients.UpdateClient{ Name: "Updated Name",}, &fieldmaskpb.FieldMask{ Paths: []string{"name"},})if err != nil { // handle}_ = updated.ClientDeleteClient
Section titled “DeleteClient”#asyncDeleteClient
Runs DeleteClient and returns the result.
Request context
Client ID.
error
if err := scalekitClient.Client().DeleteClient(ctx, "client_123"); err != nil { // handle}AddClientSecret
Section titled “AddClientSecret”#asyncAddClientSecret
Runs AddClientSecret and returns the result.
Request context
Client ID.
The created resource.
RemoveClientSecret
Section titled “RemoveClientSecret”#asyncRemoveClientSecret
Runs RemoveClientSecret and returns the result.
Request context
Client ID.
Secret id.
error