Help please with authentification

Started by DigPeter, October 27, 2017, 10:35:34 PM

Previous topic - Next topic

DigPeter

I have set up authentification as ahown in the attached screen grabs.  When I try to log into IWV,  the error dialog shown in the 2nd attachment appears.

Where have I gone wrong.

With authentification disable, IWV runs OK.

Mario

Do you see the user name & password input field in your browser when you try to connect?
Correct user name / password entered?

I just tried here and it works.
Clear the cache of your browser perhaps.

Also, the log files produced by IMWS (IMATCH_WEBSERVICE_LOG.TXT in the c:\windows\temp folder) may contain additional info.
You can also enable extra debugging options and even a web server log file in the Advanced options in the WebService Controller application.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Quote from: Mario on October 28, 2017, 08:31:18 AM
Do you see the user name & password input field in your browser when you try to connect?
Correct user name / password entered?
Yes - user name: peter  -- password: barber

QuoteI just tried here and it works.
Clear the cache of your browser perhaps.
But it works if authentification is disabled.

Mario

The problem is the authentication. IMWS returns an error (401, unauthrized) that states that either the user name or password is incorrect.
Of course without authentication this error will never happen.

User name and password are case-sensitive.
Try another browser.
Disable all browser plug-ins, cookue blockers and whatnot.

For further diag I would need all log files.
In the controller application > Configure > Advanced  enable the access and error log files by providing a file name for both, e.g.

c:\temp\IMWS_access.txt
c:\temp\IMWS_error.txt

(match the path to your system!)

Then retry to log in with authentication.


Copy all log files, including the IMWS_ log file from c:\windows\temp into a ZIP and attach.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Mario - thanks.

I have manged to get it working on authentification.  You might have noticed in the attachments that all folders .*  are excluded and just My Pictures folder in the C drive are included.  The attchment below shows that no folders in the database, some 57000 files in keywords.  This is the total number of image files in both the C & G drives.  What is wrong?

Mario

1. You got the authentication going how?

2. What happens when you click on one of these categories? Are files displayed?
If not, nothing's wrong. The counts are not affected by you restricting access  to one or more folders. The files are still in these categories.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Quote from: Mario on October 28, 2017, 02:36:06 PM
1. You got the authentication going how?
Not sure - I "tuned up" with AVG Tune-up.  That clears out a lot of rubbish.

Quote2. What happens when you click on one of these categories? Are files displayed?
If not, nothing's wrong. The counts are not affected by you restricting access  to one or more folders. The files are still in these categories.
Yes - files are displayed, but files from the unwanted (G) drive are also being displayed.

      Why are no folders displayed? 

Mario

Show me your ACLs and your folder structure.
Also attach the IMWS log file because it contains info about the ACls and how they are applied.
The file window in WebViewer is filtered by the ACLs - by all of them. It should not show files from the G: drive if the ACLs are correct.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

The screen grabs for authentification are attached.  IMA4.jpg gives the ACL details.

Also attached is the log file.

Mario

#9
I've tried to test this.

For one of my test databases. It has one big folder hierarchy.
I exclude all folders with .* and then include only the folder with Wedding images with the expression: "Wedding\\.*"

Result:

On this folder is shown in WebViewer.
The folder has 34 files.
The Category Navigator shows a maximum of 34 files as well.
So at least here, things are correct.

I modeled this based on the screen shot 4, where you exclude all folder and then include the "peter" folder.

You should see only this folder in the Navigator, correct? If not, your expression is wrong. Use the built-in test in the expression dialog to ensure that your expression matches your folder names.

How is your folder hierarchy structured. Do you havfe multiple top level folders? Disks?

This is what it looks like:
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Mario - thanks.

The folder I wish to include is C:\Users\Peter\My Pictures - see screen shot attachment IMA7.

In ACL I entered "c:\\Users\\Peter\\My Pictures.*" - see screen shot attachment IMA8.  As you can see this does not work. 

Can you see what is wrong?

DigPeter

#11
Further to the last post, i notice from help that the test pattern should have only single'\'.  The pattern 'c:\Users\Peter\My Pictures\.*' checks OK.  But, the expression still does not work.  IWV still does not show any folders in database and now there are NO files in categories.    :'(

Mario

The \ has a special meaning in regular expressions (it is the 'escape' character).

This is why you need to double it when you want to create a regular expression which specifies a Windows folder name:

Regular expression: c:\\images\\beach.*

The folder name

c:\images\beach

matches the above regular expression.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

I understand that and that is what I am using.  Why does the expression not work?

Mario

Because you use \\ in your test pattern instead of a single \
The test pattern is not a regular expression, it's plain text - no doubling of \ needed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Maio - I am talking about the expression not the test pattern.  The expression has the double '\' and mirrors the folder name in IMA7, but  IWV still does not show any folders in database and now there are NO files in categories.    :'(

Mario

In you screen shot you show us that you include the  users....peter folder. Is this really the name under which the folder is listed in your database? Not missing a level or something?

Tip: You can copy the folder name in IMatch into the clipboard and then paste it into the ACL regular expression field. Double the \ to make it work.
It should then match when you paste it into the test field.

I'm not sure how I can help further. I tried it here and it just works. No other reports either.
Must be something really specific with your setup.

Try with a simpler pattern perhaps, including "test"
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Mario

#17
I have now recreated (I think) your environment.

I've added "C:\Users\Mario\Pictures" with a couple of files and sub-folders to my test database.
The I created a group with two folder ACLs:

1. Exclude .*
2. Include C:\\Users\\Mario\\Pictures\\.*



and assigned this group to my user account (Mario, with Admin privileges).

The outcome is as expected:

1. Only the files and folders in "C:\Users\Mario\Pictures" and below are visible in WebViewer.
2. There is a total of 18 files visible in WebViewer
3. This also extends to Categories and Collections. They also show only the 18 files.

As far as I can tell, controlling user access to database objects via ACLs works as designed.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Again - many thanks, Mario. 
I have now:
- refreshed the IMA database from the IMatch2017 database. 
- changed the exclusion from \\.* to G:\\.*

The results are now as described in your last post.  So problem solved, but it leaves the question why my system does not seem to like the general exclusion \\.*    Would it be the cache still holding images generated before I tried using authentication and ACL?  Or perhaps refreshing the database js the reason?

Mario

Quotelike the general exclusion \\.*

This cannot work. You exclude everything that starts with a \ ? ? ?
As documented (see help), to exclude everything just use: .*
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

For me neither \\.* nor .* excludes the G Drive.  But G:\\.* does exclude the G Drive.  I am happy to work with that.

Mario

That is strange indeed. I just looked at the implementation in IMWS.

It iterates over all folder names and applies the regular expression to know which folders to include or exclude.
For the expression .* it always finds all folders in the database in my experiments. I have used databases with 1 to 4 drives and even UNC paths.

I have no idea why .* could not match a string like G:\some folder.
What is the top-level folder name for the G: drive in your database? Even G:\ will work with .* ...
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Quote from: Mario on October 30, 2017, 06:12:05 PM
What is the top-level folder name for the G: drive in your database? Even G:\ will work with .* ...
"Digital originals"

Mario

As in "G:\Digital originals" ?

Tried that (with C:\... instead of G:) but the folder is correctly excluded.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

DigPeter

Yes - it is where my raw files are kept

Mario

Since I cannot repro this and you have found a working solution, I'll let this rest now.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook