node-saml / passport-saml

SAML 2.0 authentication with Passport

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Wrong readme example for authnContext for ADFS

jyenduri-uptycs opened this issue · comments

To Reproduce

I am trying out ADFS based on the example authContext is a string, but looks like it is only working if we give it as an array

{
entryPoint: 'https://ad.example.net/adfs/ls/',
issuer: 'https://your-app.example.net/login/callback',
callbackUrl: 'https://your-app.example.net/login/callback',
cert: 'MIICizCCAfQCCQCY8tKaMc0BMjANBgkqh ... W==',
authnContext: 'http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/windows',
identifierFormat: null
}

Working example

{
entryPoint: 'https://ad.example.net/adfs/ls/',
issuer: 'https://your-app.example.net/login/callback',
callbackUrl: 'https://your-app.example.net/login/callback',
cert: 'MIICizCCAfQCCQCY8tKaMc0BMjANBgkqh ... W==',
authnContext: ['http://schemas.microsoft.com/ws/2008/06/identity/authenticationmethod/windows'],
identifierFormat: null
}

Expected behavior
We need to update the README and examples

Environment

  • Node.js version: v12.14.0
  • passport-saml version: 3.1.2

@cjbarth Here is the Pull request #647

@cjbarth Can you please look at this pull request #647

Agreed. This appears to be an undocumented breaking change with the version 2.x since we had working code passing only a string as an authncontext before...

I found the commit that created the break. It was my commit, and I overlooked updating the documentation. Thanks for catching this.