1 (edited by michaelweideli 30-07-2012 10:34:17)

Re: Indicia log in

Hi

I have set up the IndiciaLogin control attempting to follow the wiki instructions. What I have done works, but I can't get It to return a valid login. Any ideas appreciated.   

I have been told that this method is no longer being used, so if there are details anywhere of how to implement an alternative solution this might be a better approach.

Mike

$website_id = 36;
          $website_password = '(my password in here';   
           $readAuth = user_helper::get_read_auth($website_id, $website_password);
              // set options for case insensitive name comparison and to request the user profile data
              $options = array('namecase' => false, 'getprofile' => true);
              // make the call to indicia core to authenticate the user. This call is encrypted.
   
            $response = user_helper::authenticate_user($_POST['username'], $_POST['password'],
             $readAuth, $website_password, $options);       
              // act on the result
              $user_id = $response['user_id'];
              if ($user_id > 0) { // authenticated successfully
                // continue to logged in part of site, getting profile data if wanted
                $profile = $response['profile'];
                // or if we hadn't got profile on login, we could make the call on the next line.
                 $profile = user_helper::get_user_profile($user_id, $readAuth);
               echo("hello");
} else { // not authenticated
                  echo("not ok");
              }

Mike Weideli
(R6 User - not receiving any funding for providing this support)

2

Re: Indicia log in

Hi Mike

I just took a quick glance at the wiki page I guess you are looking at, http://code.google.com/p/indicia/wiki/TheIndiciaLoginControl. I haven't used this myself.

I am wondering what you are wanting to achieve. I have the impression that you are building a site with Drupal, in which case I'm not sure you need this control as Drupal can manage authentication of users in to your website.

What you might well want to do is submit records to the warehouse with an Indicia user ID attached so that it is possible for a user to submit records across several Indicia-powered sites yet view all their records in one place (e.g. iRecord). To do this there is the Easy Login module, http://code.google.com/p/indicia/wiki/InstantIndiciaEasyLogin.

I think this module is part of version 0.8.1 which also contains many other improvements and must be due for imminent release.

Jim Bacon.

3 (edited by michaelweideli 30-07-2012 11:28:26)

Re: Indicia log in

Hi Jim

I am just following what is on the wiki and trying out what is there. Doesn't seem that this isn't the way to go now.  Couldn't get the Easy Login module to work so tried this one. Will have another go. 


Mike

Mike Weideli
(R6 User - not receiving any funding for providing this support)

4

Re: Indicia log in

Having written my first post I thought perhaps a bit more clarification about Indicia, authentication and identification of records would be helpful in general.

The Indicia Warehouse can maintain a list of users and passwords. Those users may be able to log in to the warehouse website with privileges determined by their role. Each user has an id.

When a client website sends a record to the Indicia warehouse it can identify the recorder in several ways.

1. The record can contain the recorder names as text to be put in the sample:recorder_names field.
2. The record can contain an Indicia warehouse user id to be put in the sample:created_by_id field. If a value is not supplied then the field is given the value 1 (the admin user's id)
3. The record can contain any other identifying information to be put in custom attribute fields.

A recorder does not need an account with the Indicia Warehouse to submit a record. In fact a record can be stored that is entirely anonymous but that does not constitute a biological record that is going to be acceptable for broad use.

Now, because it is not an uncommon wish for a recorder to want to be able to review their own records or edit them, having an infallible way of associating them to their records and a secure way of providing access is a common requirement. Thus arises the client website where recorders have to log in.

If you are building a website without a framework that provides user management then you might wish to use the Indicia warehouse user list and the IndiciaLogin control in order to build your own log in system. However, generally we have opted to use Drupal. Then, when we have been saving records, we have included custom attributes in which the Drupal username and Drupal id are stored. The recorder still doesn't have an Indicia Warehouse account but we can identify them uniquely within the context of that client website. This is the approach used within the tutorial, http://indicia.googlecode.com/files/Instant%20Indicia%20Tutorials%20v1.4.pdf.

Now we realised that actually, users might be submitting records to a warehouse via several different websites and we thought how good it would be if all their records could be joined together. In order to do that we need to have a single id for a user that is shared by all websites. This is what the EasyLogin module allows. Any user registering with a Drupal site that has this module enabled will ask the Indicia Warehouse if it already knows that user (based on email address, for example). If the user is already known to the warehouse then their Indicia id is returned; if not then the user is created and their new id is returned. Either way, Drupal stores the id and can send it with every record from that user.

Having a quick look at the repository, it seems to me as if the EasyLogin module is only in the trunk so you might not have it installed.

Just as a side note, in case there is any confusion, quite separately, every client website, when communicating with an Indicia warehouse, is authenticated by virtue of the website id and website password which both know. This ensures that communication is with valid client websites.

Jim Bacon.

5

Re: Indicia log in

Hi

Thanks. I will follow your advice. May need some help with EasyLogin as no success so far .

Mike

Mike Weideli

6

Re: Indicia log in

Hi Mike,

I've only used the Easy Login once so far, although I'll be rolling another site with it soon. As I recall I pretty much enabled it and it worked. You have to have the dependent modules installed and enabled naturally. Once installed, log out and create a new account as if you were a new visitor to the site and the magic happens.

In Drupal you see a profile field for the new user containing their Indicia ID, once you are logged in as admin again. On the warehouse you see a new user if the user you created in Drupal did not previously exist on the warehouse.

Jim Bacon

7

Re: Indicia log in

Login is now working in my trial version of  InstantIndicia which I assume uses the EasyLogin, but as you say there doesn't seem to be any access to this which would make it useable in an implementation which doesn't use InstantIndicia. I think I can see why the code in my original post doesn't work and could probably do something with it, but am I missing something, or  is there something in the pipleine which will make this unecessary  ?



Mike

Mike Weideli

8

Re: Indicia log in

Hi Mike,

I think you might be missing something as I sense a degree of mutual incomprehension. Use of the Login Control mentioned in your first post is appropriate for a non-Drupal site but optional. Use of the Easy Login module for a Drupal site is also optional but will probably be recommended in future.

I am still a bit unconfident whether you are using the Easy Login module or not. In your Drupal site can you go to admin/build/modules/list and confirm that the Easy Login module in the Indicia Miscellaneous Features section exists and is checked.

Thanks,
Jim Bacon.

9

Re: Indicia log in

Hi Jim

Sorry for the confusion. There is no Easy login module available for me to tick which is the problem.

Mike

Mike Weideli

10

Re: Indicia log in

Hi Mike,

That clarifies things a bit. Depending on what you want to achieve, you can either download the Easy Login module from the repository or continue without it.

If you are currently experimenting with Instant Indicia I suggest you continue without it for now. The tutorial provides a structured introduction.

Jim Bacon.

11

Re: Indicia log in

Hi

It will be of more help to me not to worry too much about Instant Indicia. It seems to me that the best long term approach is to install the module. However, I have searched for it without success  . Do I have access to it and if so where?

Mike

Mike Weideli

12

Re: Indicia log in

Hi Mike
Easy Login is a new module so not yet in the version of Instant Indicia that is available to download. I've emailed you the latest code for it.
Best wishes

John van Breda
Biodiverse IT

13

Re: Indicia log in

Hi

As John says, there is no versioned release of the module as yet but anyone can download it from the repository. The path to it is svn/drupal/modules/indicia_features/trunk/indicia_features/easy_login. A Subversion client is helpful for obtaining code. I use TortoiseSVN

Jim Bacon

14

Re: Indicia log in

Hi

Thanks for all the help. I have now have this working/ Also implemented tortoisesvn as suggested. Moving onto next stage.

Mike

Mike Weideli