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

DXCDT-536: Add pkce and attribute_map settings to OIDC and Okta connections #277

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions management/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,9 @@ type ConnectionOptionsOkta struct {
SetUserAttributes *string `json:"set_user_root_attributes,omitempty"`
NonPersistentAttrs *[]string `json:"non_persistent_attrs,omitempty"`
UpstreamParams map[string]interface{} `json:"upstream_params,omitempty"`

ConnectionSettings *ConnectionOptionsOIDCConnectionSettings `json:"connection_settings,omitempty"`
AttributeMap *ConnectionOptionsOIDCAttributeMap `json:"attribute_map,omitempty"`
}

// Scopes returns the scopes for ConnectionOptionsOkta.
Expand Down Expand Up @@ -802,6 +805,35 @@ type ConnectionOptionsOIDC struct {
NonPersistentAttrs *[]string `json:"non_persistent_attrs,omitempty"`

UpstreamParams map[string]interface{} `json:"upstream_params,omitempty"`

ConnectionSettings *ConnectionOptionsOIDCConnectionSettings `json:"connection_settings,omitempty"`
AttributeMap *ConnectionOptionsOIDCAttributeMap `json:"attribute_map,omitempty"`
}

// ConnectionOptionsOIDCConnectionSettings contains PKCE configuration for the connection.
//
// PKCE possible values:
//
// auto - Uses the strongest algorithm available.
// S256 - Uses the SHA-256 algorithm. Auth0 does not currently support RS512 tokens.
// plain - Uses plaintext as described in the PKCE specification.
// disabled - Disables support for PKCE.
//
// Setting the PKCE property to a value other than auto may prevent a connection from
// working properly if the selected value is not supported by the identity provider.
type ConnectionOptionsOIDCConnectionSettings struct {
PKCE *string `json:"pkce,omitempty"`
}

// ConnectionOptionsOIDCAttributeMap contains the mapping of claims received from the identity provider (IdP).
type ConnectionOptionsOIDCAttributeMap struct {
// Scopes to send to the IdP's Userinfo endpoint.
UserInfoScope *string `json:"userinfo_scope,omitempty"`
// Method used to map incoming claims.
// Possible values: `use_map`, `bind_all`, `basic_profile`.
MappingMode *string `json:"mapping_mode,omitempty"`
// Object containing mapping details for incoming claims.
Attributes map[string]interface{} `json:"attributes,omitempty"`
}

// Scopes returns the scopes for ConnectionOptionsOIDC.
Expand Down
74 changes: 74 additions & 0 deletions management/management.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions management/management.gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.