loopback-next icon indicating copy to clipboard operation
loopback-next copied to clipboard

Implement SAML strategy in passport-login example

Open jannyHou opened this issue 5 years ago • 7 comments

Suggestion

From https://github.com/strongloop/loopback-next/issues/4738#issuecomment-698543534

Implement SAML passport strategy in the passport-login example. cc @pilare

Use Cases

User can login using SAML authentication.

Examples

same ^

Acceptance criteria

  • [ ] Add a new login tutorial + example for SAML authentication.

jannyHou avatar Sep 24 '20 20:09 jannyHou

@jannyHou thank you for opening this. I did change the code of passport-saml package and submitted PR there for the bug mentioned by @L-Luciano. It did help with sending the proper login-request out without modifying loopback-autentication package. I still have issues on the way back. By default it’s a POST and it seems that the the response object in the interceptor doesn't have access to SAMLResponse in body, which I can see, on the request that I'm getting in the browser. Without this the passport-saml goes back to to login-request mode. I’m still working on it and will report if I will make progress there. Right now I'm trying it on as SAML2 stub, which works great with other Node with Express passport-saml examples.

pilare avatar Sep 25 '20 16:09 pilare

@jannyHou I got working. Problem with the missing body was the body-parser on the express app, that is handling the web application. I've added extended urlencoding and that solved the issue.

app.use(bodyParser.urlencoded({
  extended: true
}));

Now I need to incorporate this into my project. I will try to clean up my solution and try to post PR here to expand the example project, or help the others with testing.

pilare avatar Sep 26 '20 14:09 pilare

@pilare That would be great! Thank you so much on working on it actively 👍 . Looking forward to see your PR, I can help review and land it.

jannyHou avatar Sep 29 '20 17:09 jannyHou

This issue has been marked stale because it has not seen activity within six months. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository. This issue will be closed within 30 days of being stale.

stale[bot] avatar Jul 14 '21 06:07 stale[bot]

@pilare Could you please share your code regarding this issue - even if it's not clean?

rizz360 avatar Jul 30 '21 12:07 rizz360

@rizz360 I will sit on this over the weekend, and try to add my implementation to the single sign on example app.

pilare avatar Aug 04 '21 21:08 pilare

@pilare Thank you for your reply! I'm sorry but I couldn't find where you pushed your implementation

rizz360 avatar Sep 01 '21 06:09 rizz360