tngan / samlify

Node.js library for SAML SSO
https://samlify.js.org
MIT License
601 stars 214 forks source link

How can I specify AttributeConsumingService in sp metadata? #506

Open Sczlog opened 1 year ago

Sczlog commented 1 year ago

In SpMetadata constructor I see AttributeConsumingService is assigned to descriptor but I can't assign it through ServiceProvider unless I input raw metadata. How can I configure it by code?

KirillTertunov commented 1 year ago

In SpMetadata constructor I see AttributeConsumingService is assigned to descriptor but I can't assign it through ServiceProvider unless I input raw metadata. How can I configure it by code?

Hi, yep you can. I searched in code and found that

assertionConsumerService: [
        { Binding: 'your_binding',  Location: `your location` },
      ],

It didn't mentioned in docs. It was mentioned as String[] - but isn't true as you see

Sczlog commented 1 year ago

@KirillTertunov that was assertionConsumerService not AttributeConsumingService, are they the same?

KirillTertunov commented 1 year ago

@KirillTertunov that was assertionConsumerService not AttributeConsumingService, are they the same?

yep, you can find an answer here - 'test/index.ts'

Sczlog commented 1 year ago

you should check https://github.com/tngan/samlify/blob/43ac2964dc61af4d8710342107c16c65f32c9bf6/src/metadata-sp.ts#L63-L69 they are different properties