Announcement

Collapse
No announcement yet.

Login to EspoCRM via API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Login to EspoCRM via API

    Hi,

    i searched the last 3 days for an answer but i don't find anything.
    I have a site with a login form. Now, i want rebuild my website with an user check to Espo.

    For example:
    - The use visit my index-site with an authentification form.
    - He type the EspoCRM-User datas in this form.
    - My site (PHP) check the userdata to Espo and if the user is allowed to login, my sites open.
    => To this point i don't have any problems. With the API i got the user data and can check if he is allowed.
    - In my own portal is a link to espo and when i click the link i will be transferred to the startpage in Espo.
    => And here is the problem. Every way i tested and tried to open Espo i will be transferred to the Login-Page. But i have the User-Datas and will be linked direct in Espo.

    The user can be a "normal" user or an portal user.
    Can everybody help please?

    Thanks
    Lars


  • #2
    Check out my code in a previous post:
    I've been stuck for a week on the api call for the "Espo-Authorization" When I run some tests pages that are on a server with the same IP address as

    Comment


    • #3
      I had read and tested the code in the post , but if i make
      ...
      } else {
      $data = json_decode($output, true);
      $_SESSION['user_id'] = $data['user']['id'];
      $_SESSION['first_name'] = $data['user']['firstName'];
      $_SESSION['last_name'] = $data['user']['lastName'];
      header("Location:/espo/#RealEstateProperty");
      exit;
      }
      ...
      it's open only the login-page of espo.
      I've copied the whole code, edit my url and changed (for tests) the username and password fix in the vars.
      Is the secure-function necessary?

      Comment


      • #4
        I'm not sure what you're asking.

        The code that I gave the example for is a site that is on another server and completely different than the domain/server for the EspoCRM.

        Comment


        • #5
          What i am looking for is a script that do:
          A user goes to:

          Login with his userdatas.
          Username: testuser
          Password: testuser
          The login authenticated the user and the start screen of espo or in best case the startpage of my intranet will be open without another login.

          I want Espo as a authentification system for an intranet. Because i have some tools in the intranet which i don't can integrate to espo. And the user should be able to switch between the two systems with only one login.

          Comment


          • #6
            If this problem is not fixed yep
            I think you have to include a script on the ESPOcrm frontpage. By default ESPO do not have property in the url so your $_SESSION['user_id'] will not work.
            You have to include that property in the url ie. http://YOURESPO.COM?userid=testuser&password=password. And then the custom script in ESPO can add that value in the form.

            Comment

            Working...
            X