Skip to content

Commit

Permalink
Handle missing IdP trait in PAM interpolation. (#6558) (#6768)
Browse files Browse the repository at this point in the history
  • Loading branch information
xacrimon authored May 6, 2021
1 parent d819160 commit f0a5923
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/srv/ctx.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,13 @@ func getPAMConfig(c *ServerContext) (*PAMConfig, error) {

result, err := expr.Interpolate(traits)
if err != nil {
// If the trait isn't passed by the IdP due to misconfiguration
// we fallback to setting a value which will indicate this.
if trace.IsNotFound(err) {
log.Warnf("Attempted to interpolate custom PAM environment with external trait %[1]q but received SAML response does not contain claim %[1]q", expr.Name())
continue
}

return nil, trace.Wrap(err)
}

Expand Down

0 comments on commit f0a5923

Please sign in to comment.