From 8730a1685e185d681392e17f5f402e60dce8b152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Thu, 13 Apr 2023 12:25:49 +0300 Subject: [PATCH] feat: custom endpoint for device authorization (#368) --- pkg/op/op.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/op/op.go b/pkg/op/op.go index ecb753e..fc5262a 100644 --- a/pkg/op/op.go +++ b/pkg/op/op.go @@ -476,6 +476,16 @@ func WithCustomKeysEndpoint(endpoint Endpoint) Option { } } +func WithCustomDeviceAuthorizationEndpoint(endpoint Endpoint) Option { + return func(o *Provider) error { + if err := endpoint.Validate(); err != nil { + return err + } + o.endpoints.DeviceAuthorization = endpoint + return nil + } +} + func WithCustomEndpoints(auth, token, userInfo, revocation, endSession, keys Endpoint) Option { return func(o *Provider) error { o.endpoints.Authorization = auth