ZOOM and SSO Lambda writing
-
As per https://www.reddit.com/r/Zoom/comments/go3s19/sso_with_fusionauth/?utm_source=share&utm_medium=web2x
How do I write to remove the recipient in Lambda? I am not proficient in writing lambda at all.
I tried something like this samlResponse.assertion.subject.confirmation.recipient=[''];
-
That's how I'd write it. Did that not work?
You could try
samlResponse.assertion.subject.confirmation.recipient = null
as well.Since the lambda is javascript, you could also try iterating the
samlResponse.assertion.subject.confirmation
object and removing therecipient
key, though I'm unsure if that will work.Please let us know.
-
@onmybus said in ZOOM and SSO Lambda writing:
samlResponse.assertion.subject.confirmation.recipient=[''];
No, a lot of the issues seems it either can't set a method or it's undefined.
In this case recipient is undefined. -
Hmm. Can you log the samlResponse object using console.log and share the structure?
I'm kinda shooting in the dark right now, as we haven't tested with Zoom. There's an open issue to do so: https://github.com/FusionAuth/fusionauth-issues/issues/643
-
@onmybus We'll need to do some more research into that error, @dan had some good insight in the reddit thread. Perhaps we are not building the response correctly.
If you wan try @dan's suggest, I think the SAML Populate lambda would look like this: ( @dan was really close)
function populate(samlResponse, user, registration) { samlResponse.assertion.subject.subjectConfirmation.recipient = null; }
Here is how we are building that
subject
object:String callback = samlv2Configuration.callbackURL.toString(); response.assertion.subject = new Subject(); response.assertion.subject.subjectConfirmation = new SubjectConfirmation(); response.assertion.subject.subjectConfirmation.inResponseTo = request.id; response.assertion.subject.subjectConfirmation.method = ConfirmationMethod.Bearer; response.assertion.subject.subjectConfirmation.notBefore = now.minusHours(1); response.assertion.subject.subjectConfirmation.notOnOrAfter = now.plusHours(1); response.assertion.subject.subjectConfirmation.recipient = callback;
As a side note, the way you can debug this, is to dump out the
samlResponse
object to an event log. For example, add this to your lambda body and thesamlResponse
object will be pretty printed to aninfo
event log. SeeSystem > Event Log
.console.info(JSON.stringify(samlResponse, null, ' '));