0

I want to avoid setting up and handling custom authentication for my custom REST API module because I have already setup SSO to the API server for Drupal users.

The question: how do I tie that login to my module, so it checks the current user, and sees that the current Drupal user is already SSO-authenticated?

closed as too broad by leymannx, Jdrupal, Jaypan, kiamlaluno Oct 5 at 8:50

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Your question doesn't really make sense in the terms of what a Drupal module is, so it's not clear what exactly you are asking. – Jaypan Oct 4 at 22:11
  • Since it's a question about code to write, this question is too broad. We don't know how the SSO authentication is implemented, so we cannot say how a module could check if a user has been authenticated via SSO. Tie that login to my module doesn't have sense in Drupal as logins are tied to the site, not a module. A module could eventually implement a new authentication system, but users aren't logged-in in the module; they are logged-in on the site using that module. – kiamlaluno Oct 5 at 8:59
  • Thank you for helping me to see my confusion. I was informed by the client that the endpoint I was trying to use can only be hit using basic auth. (otherwise the logged in user should have had access). I had mistakenly thought (since it wasn't working) that I would have to do something in order for SSO user to authenticate (turns out module needs to be passing separate authentication credentials in order to use my endpoint). – Jeff Brewster Oct 7 at 17:00