API Single Sign On

Suggestions, General Discussion and Feature Requests about eFront

API Single Sign On

Postby bpalozzi » Tue Oct 05, 2010 1:25 pm

I am trying to perform a single sign-on through the API, but it does not work.

I do get a token,

I do get back a status of "OK",

but when I redirect to the userpage.php page or the index.php page I get an error message in the url : "http://x.x.x.x/www/index.php?message=The+resource+that+you+requested+requires+that+you+login+first+%28418%29&message_type=failure"

does anyone know how to fix this? or does anyone have any sample code?

I know that I am close.
bpalozzi
 
Posts: 2
Joined: Wed Sep 01, 2010 8:20 pm

Re: API Single Sign On

Postby papagel » Tue Oct 05, 2010 5:30 pm

You just login to the API, you need to further login to the system with a user....
eFront- eLearning and Skill Development Solution for Companies and Educational Institutes
User avatar
papagel
 
Posts: 1568
Joined: Wed Oct 03, 2007 5:07 pm

Re: API Single Sign On

Postby bpalozzi » Tue Oct 05, 2010 5:40 pm

I am using:

api2.php?action=efrontlogin&token=<token>&login=<login>

which i thought was the command to log a user into the platform (eFront). I get "ok" as a response but then when I try to redirect to "index.php" it shows me the login screen and when I try to redirect to "userpage.php" it shows a message that the user needs to login in first.

am I redirecting to the wrong page?
bpalozzi
 
Posts: 2
Joined: Wed Sep 01, 2010 8:20 pm

Re: API Single Sign On

Postby skippybosco » Wed Oct 06, 2010 1:11 am

@bpalozzi: the login function authenticates for use with the API, not the eFront system itself.

If you would like to programatically sign the user in to the eFront system I would suggest setting the user cookies for eFront from your 3rd party app.

Example:
Code: Select all
setcookie("cookie_login", $member[login],time()+3600,'/','.'.str_replace('www.','',$_SERVER['HTTP_HOST']));
setcookie("cookie_password", md5($member[pass].G_MD5KEY),time()+3600,'/','.'.str_replace('www.','',$_SERVER['HTTP_HOST']));
User avatar
skippybosco
 
Posts: 2150
Joined: Fri Aug 22, 2008 7:58 am

Re: API Single Sign On

Postby nelson.ragandap » Tue Sep 06, 2016 9:10 am

Im kindda new and still exploring programming. Im developing a login page as a 3rd party site then I would like it to be redirected to the efront component as a logged user.

I came across this answer about utilizing cookies, I tried but I still dont get it. =( i've replaced the username and password ive created the cookies but its not yet working. I must be missing something. Is there anyone who have create a working php page?
nelson.ragandap
 
Posts: 3
Joined: Wed Aug 03, 2016 8:47 am

Re: API Single Sign On

Postby skippybosco » Wed Sep 07, 2016 2:10 am

When using the setcookie method, the user and matching password must already exist in eFront.
User avatar
skippybosco
 
Posts: 2150
Joined: Fri Aug 22, 2008 7:58 am


Return to eFront

Who is online

Users browsing this forum: No registered users and 1 guest

cron