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

expose ForceAuthn #119

Merged
merged 1 commit into from
Sep 26, 2017
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
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