Skip to content

Commit

Permalink
expose ForceAuthn (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
dustin-decker authored and crewjam committed Sep 26, 2017
1 parent febc398 commit 5e89d54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions samlsp/samlsp.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Options struct {
IDPMetadataURL *url.URL
HTTPClient *http.Client
CookieMaxAge time.Duration
ForceAuthn bool
}

// New creates a new Middleware
Expand Down Expand Up @@ -54,6 +55,7 @@ func New(opts Options) (*Middleware, error) {
MetadataURL: metadataURL,
AcsURL: acsURL,
IDPMetadata: opts.IDPMetadata,
ForceAuthn: &opts.ForceAuthn,
},
AllowIDPInitiated: opts.AllowIDPInitiated,
CookieName: defaultCookieName,
Expand Down
5 changes: 5 additions & 0 deletions service_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ type ServiceProvider struct {

// Logger is used to log messages for example in the event of errors
Logger logger.Interface

// ForceAuthn allows you to force re-authentication of users even if the user
// has a SSO session at the IdP.
ForceAuthn *bool
}

// MaxIssueDelay is the longest allowed time between when a SAML assertion is
Expand Down Expand Up @@ -274,6 +278,7 @@ func (sp *ServiceProvider) MakeAuthenticationRequest(idpURL string) (*AuthnReque
// urn:oasis:names:tc:SAML:2.0:nameid-format:transient
Format: &nameIDFormat,
},
ForceAuthn: sp.ForceAuthn,
}
return &req, nil
}
Expand Down

0 comments on commit 5e89d54

Please sign in to comment.