First of all excuse me , my English is not that well
I have a drupal 7 website. This website have one internet part, and one intranet part (only accessible if you are from my Institute).
I'am currently creating a authentication module. I will explain why.
Server 1 : My own website, + other.
Server 2 : a IT server which authenticate student, teacher, ... (i don't have access to this one).
Server X : other website.
actually, on other website, when i need to log in, 2 solution are available :
1) i use a login link on a webpage, i'm redirect to a login page on server 2, i enter my login and password and if it is correct, i'm redirect on my previous website, and i'm logged.
2) I try to go to a secured webpage, and i'm redirect to a login page on server 2, i enter my login and password and if it is correct, i'm redirect on my previous website, and i'm logged. (it's done with the apache conf, some url path can be protected (exemple: www.site.com, www.site.com/node/... are not proteced, but www.site.com/forum/... is protected)).
if i go to an other website, and need to be logged in, i use one of the two ways describe just above.
But, in fact,i'm already connected and known by the server 2, so i don't need to give ma login and password again.
The website, on server 1, or server X can retrieve info on user with a specific cookie. And i can retrieve some user info with a ldap (not all).
actually, i have made a module, with the admin form (which cookie to read, i can ask ldap server info)
My question is:
how to specify page, where my module will be used.
how to create user if not exist with the specified cookie info and ldap info.
how to log in user if user exist.
i do not need a whole code module, just ways to solve my problem, or a already made module, but, i've search several times.
Thank you in advance to any one who may be able to give me some ideas.