Skip to content

Commit

Permalink
Set ForceAuthn in SAML provider.
Browse files Browse the repository at this point in the history
  • Loading branch information
Joerger committed Oct 1, 2024
1 parent 37429c8 commit 48be7f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/types/saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ type SAMLConnector interface {
IsMFAEnabled() bool
// WithMFASettings returns the connector will some settings overwritten set from MFA settings.
WithMFASettings() error
// GetForceAuthn returns ForceAuthn
GetForceAuthn() bool
}

// NewSAMLConnector returns a new SAMLConnector based off a name and SAMLConnectorSpecV2.
Expand Down Expand Up @@ -424,6 +426,11 @@ func (o *SAMLConnectorV2) WithMFASettings() error {
return nil
}

// GetForceAuthn returns ForceAuthn
func (o *SAMLConnectorV2) GetForceAuthn() bool {
return o.Spec.ForceAuthn
}

// setStaticFields sets static resource header and metadata fields.
func (o *SAMLConnectorV2) setStaticFields() {
o.Kind = KindSAMLConnector
Expand Down
1 change: 1 addition & 0 deletions lib/services/saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ func GetSAMLServiceProvider(sc types.SAMLConnector, clock clockwork.Clock) (*sam
SPKeyStore: keyStore,
Clock: dsig.NewFakeClock(clock),
NameIdFormat: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
ForceAuthn: sc.GetForceAuthn(),
}

// Provider specific settings for ADFS and JumpCloud. Specifically these
Expand Down

0 comments on commit 48be7f8

Please sign in to comment.