mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-03 01:48:02 +02:00
Add new device_auth_client_type setting to allow attaching the client_secret to device auth requests
This commit is contained in:
parent
fb7440a607
commit
bd5ad2e909
9 changed files with 1052 additions and 984 deletions
|
@ -1,6 +1,8 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/pomerium/pomerium/internal/urlutil"
|
||||
"github.com/pomerium/pomerium/pkg/grpc/identity"
|
||||
)
|
||||
|
@ -30,13 +32,21 @@ func (o *Options) GetIdentityProviderForPolicy(policy *Policy) (*identity.Provid
|
|||
return nil, err
|
||||
}
|
||||
|
||||
deviceAuthClientType := "public"
|
||||
if o.DeviceAuthClientType != "" {
|
||||
if deviceAuthClientType != "public" && deviceAuthClientType != "confidential" {
|
||||
return nil, fmt.Errorf("config: invalid device auth client type %q", o.DeviceAuthClientType)
|
||||
}
|
||||
deviceAuthClientType = o.DeviceAuthClientType
|
||||
}
|
||||
idp := &identity.Provider{
|
||||
ClientId: o.ClientID,
|
||||
ClientSecret: clientSecret,
|
||||
Type: o.Provider,
|
||||
Scopes: o.Scopes,
|
||||
Url: o.ProviderURL,
|
||||
RequestParams: o.RequestParams,
|
||||
ClientId: o.ClientID,
|
||||
ClientSecret: clientSecret,
|
||||
Type: o.Provider,
|
||||
Scopes: o.Scopes,
|
||||
Url: o.ProviderURL,
|
||||
RequestParams: o.RequestParams,
|
||||
DeviceAuthClientType: &deviceAuthClientType,
|
||||
}
|
||||
if policy != nil {
|
||||
if policy.IDPClientID != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue