Open Auth 0.4.0 in Orchard 1.1

Topics: Administration, Customizing Orchard, General, Troubleshooting
Apr 12, 2011 at 5:31 PM

I downloaded a new instance of Orchard 1.1 and installed the Open Auth v0.4.0 module. I enabled it as well as the Facebook login feature, however, I cannot seem to find where to configure my Facebook Client ID and Secret on the new version of Orchard. The configuration options used to be on the Settings screen, but they are no longer there. Any ideas on how to configure Open Auth on Orchard 1.1? Does the module need to be updated for 1.1 before it can be used? Thanks.

Apr 13, 2011 at 11:10 PM

I to am having this same problem...

Apr 14, 2011 at 5:31 PM

The author of the Open Authentication module has acknowledged that there are some compatibility issues which he needs to sort out. He mentions there will be an update in the next few days.

Apr 18, 2011 at 8:00 PM

The author posted an updated Module in the Gallery...I updated from within my website admin area and it appears to be working great. There is a new area under settings named OpenAuthentication where you can configure the ID's and Secrets. Thanks a bunch!

Developer
Apr 18, 2011 at 8:13 PM

Hey Guys,

I posted the update out and hopefully I ironed out most bugs. :S Sorry for the delay but I didnt want to roll out broken code!!

Next release is going to focus on individual permissions for facebook and other supported providers, to give you guys more control over what is going on. Also, a facebook connect part will be rolled out as well to complement the Microsoft Connect signin part.

Let me know if you have any bugs or suggestion, feedback always welcome :) I will update the documentation to help a little later on.

Nick

Developer
Apr 19, 2011 at 6:05 PM

Hey All,

I am having problems with creating this package, errors have been reported with missing dlls, and I have checked the NuGet package and it seems the package does not seem to include them in the bin folder. Is there any reason to why

package create NGM.OpenAuthentication d:\test

doesnot produce a Nuget pacakge that contains the external dlls in the bin folder? I tried it on the Lucene project and it worked fine... but cant see any relevant differences between the two..

Please Help!!!!!

Nick

Coordinator
Apr 20, 2011 at 7:57 PM

What binaries should be included and where are they located on disk?

The logic of the "package create" command is more or less the following (I'm assuming this is Orchard 1.1, as the logic has slightly changed since 1.0):

1. Look for dependencies defined in the "csproj" file

2. For each dependency found (in modules's bin folder or by following the "HintPath" property), include it in the nupkg file unless it's an assembly referenced by "Orchard.Framework.dll" (so we don't include MVC, Razor, NHib, etc.)

If you have access to source code, you could also try stepping through the "PackageBuilder.EmbedReferenceFiles" to see what going on...

HTH,

Renaud

 

Developer
Apr 20, 2011 at 8:07 PM

Indeed this logic has changed for 1.1. Also, make sure your dll is in a path where the console application can access (e.g. if you are under medium trust it wont be possible to fetch a dll that resides outside the app folder).

Developer
Apr 20, 2011 at 8:23 PM
Edited Apr 20, 2011 at 8:25 PM

Okay so here is what I have found out

If you have the dlls under your module like so...

src\Orchard.Web\Modules\NGM.OpenAuthentication\Lib\Facebook\Facebook.dll (REFERENCED)
src\Orchard.Web\Modules\NGM.OpenAuthentication\Lib\Facebook\Facebook.Web.dll (NOT REFERENCED)
src\Orchard.Web\Modules\NGM.OpenAuthentication\NGM.Openauthentication.csproj
src\Orchard.Web\Modules\NGM.OpenAuthentication\Module.TXT
src\Orchard.Web\Modules\NGM.OpenAuthentication\ ... Lots more files and folders

The hint paths in the csproj is

    <Reference Include="Facebook">
      <HintPath>Lib\FacebookSDK_Net40_V5.0.9\Facebook.dll</HintPath>
    </Reference>

You then run 'create package NGM.OpenAuthentication d:\test' - This will produce a NuGet package, with no bin directory, though will remove the non referenced dll.

If you then move the Dlls.. and rereference -> compile -> You have this structure...

Lib\Facebook\Facebook.dll (REFERENCED)
Lib\Facebook\Facebook.Web.dll (NOT REFERENCED)
src\Orchard.Web\Modules\NGM.OpenAuthentication\NGM.Openauthentication.csproj
src\Orchard.Web\Modules\NGM.OpenAuthentication\Module.TXT
src\Orchard.Web\Modules\NGM.OpenAuthentication\... Lots more files and folders

    <Reference Include="Facebook">
      <HintPath>..\..\..\..\lib\FacebookSDK_Net40_V5.0.9\Facebook.dll</HintPath>
    </Reference>

You then run 'create package NGM.OpenAuthentication d:\test' - This will produce a NuGet package, with a bin directory, and will remove the non referenced dll.

This was run in a Full Trust Enviroment.

I will debug this and let you know anything more I come up with. Any more ideas?

Coordinator
Apr 21, 2011 at 1:02 AM

Slightly confused: Are both assemblies missing from the package (Facebook.dll and Facebook.Web.dll) or only the "NOT REFERENCED" one (i.e. Facebook.Web.dll)?

Developer
Apr 21, 2011 at 2:59 PM

I guess it's somehow connected with the fact that referenced libs (/Lib folder) reside inside project directory structure. Maybe the compiler ignores those and just doesn't duplicate the files into /bin directory?

I installed your module 0.4.5 version and it works perfectly fine on Orchard 1.1 running on IIS 7.5 - no errors during install and later on. The problem exists though, when you try running a local development Orchard instance in IIS Express (I use that as replacement for VS's Cassini). Even if I changed the trust settings from Medium to Full in Orchard Web.config, the installation problem still exists (cannot find Facebook.dll library).

Cheers, Piotr

Developer
Apr 22, 2011 at 9:00 AM

sorry for the confusion, Facebook.Web.dll is not included in the packages project which is correct, but Facebook.dll should be in the bin directory...

Developer
May 10, 2011 at 7:13 PM
Edited May 10, 2011 at 7:17 PM

Ok.

So this is what I see:

 

When we have:

Lib\Facebook\Facebook.dll (REFERENCED)
Lib\Facebook\Facebook.Web.dll (NOT REFERENCED)
src\Orchard.Web\Modules\NGM.OpenAuthentication\NGM.Openauthentication.csproj
src\Orchard.Web\Modules\NGM.OpenAuthentication\Module.TXT
src\Orchard.Web\Modules\NGM.OpenAuthentication\... Lots more files and folders

<Reference Include="Facebook">
<HintPath>..\..\..\..\lib\FacebookSDK_Net40_V5.0.9\Facebook.dll</HintPath>
</Reference>

what happens is that since the referenced DLL is outside the package, we cant really include that one in the package. So instead we look for the same DLL in the bin directory. If found, it is included in the package. Later on, when built, this DLL will be copied to the APP_Data dependencies folder and be used.

 

For the scenario:

src\Orchard.Web\Modules\NGM.OpenAuthentication\Lib\Facebook\Facebook.dll (REFERENCED)
src\Orchard.Web\Modules\NGM.OpenAuthentication\Lib\Facebook\Facebook.Web.dll (NOT REFERENCED)
src\Orchard.Web\Modules\NGM.OpenAuthentication\NGM.Openauthentication.csproj
src\Orchard.Web\Modules\NGM.OpenAuthentication\Module.TXT
src\Orchard.Web\Modules\NGM.OpenAuthentication\ ... Lots more files and folders

The hint paths in the csproj is

<Reference Include="Facebook">
<HintPath>Lib\FacebookSDK_Net40_V5.0.9\Facebook.dll</HintPath>
</Reference>

What happens is that the DLL this time is within the module structure and therefore can be successfully packed from its original location and therefore we dismiss the one on the bin directory since it just represents a copy of the previous one which is packed anyways.

 

I'm not really sure why is this a problem ? Can you elaborate on what you wanted to see happening and why is that ?

Developer
May 10, 2011 at 7:16 PM

Obviously for none of the scenarios, non referenced DLL are included. If they should be, as it works today, they need to be referenced in the csproj (even if not as a project reference but just as an include).

Developer
May 10, 2011 at 8:12 PM

The problem is that the behaviour I have witnessed is that if the dll does not exist in the bin directory when you install the module, then you witness this error http://twitpic.com/4mtkdp/full

Developer
May 10, 2011 at 8:15 PM

Both myself and Piotr noticed the same behaviour under IIS Express, and I have noticed it under full IIS.

Developer
May 10, 2011 at 8:31 PM

Also the Dlls exist in the Package on the gallery because I copy and pasted them in there after I packaged it.

Developer
May 10, 2011 at 8:40 PM
Edited May 10, 2011 at 8:42 PM

Correct. But i suspect it might not be a problem with the package at all. The file should not need to be in bin as it is packed in its original location anyways (under the libs folder in the module directory). In your package, the DLL you refer to, is duplicate. The one under bin should not be required.

Developer
May 10, 2011 at 8:43 PM

But if the one under the bin does not exist, then it blows up with the error... let me reproduce on my local so I can give you more context.

Developer
May 10, 2011 at 8:44 PM

Correct. That's what im looking at right now...

Developer
May 10, 2011 at 8:45 PM

You were able to reproduce?

Developer
May 10, 2011 at 8:46 PM

Not yet - still havent tried it :) But now i understand your problem. I'll keep you posted once I figure this out :)

Developer
May 11, 2011 at 12:07 AM
Edited May 11, 2011 at 12:16 AM

I just tried IIS, Cassini and IIS express (development from VS) and I couldn't repro this in none of them. What I did was download your module and simply delete the bin directory from it. After that i installed from local file (the modified one).

 

Could you sync to latest and give it a try ? Also, could you check if when you get that error the files in question are in the lib of the module and also in the App_data/dependencies folder ?

 

And could you also check if by any chance any of these FB DLL's could be in the GAC ?

 

Really confused about this one :/

 

Thanks,

Andre

Developer
May 11, 2011 at 12:21 AM

I have checked and the FB Dlls are not in the evil GAC :)

Sorry if your having problem reproducing it, I will write a full repo for you tomorrow if that would help?? (Tomorrow because its midnight where I am)

When I originally looked at the problem I my self could not reproduce it, the problem occured originally in 0.4.2 of the open authentication module.. like I said earlier... I will have a repro for you tomorrow.

Nick

Developer
May 11, 2011 at 12:59 AM

Thank you Nick :) That would be really appreciated :)

Developer
May 11, 2011 at 10:05 PM

Hey Andre, Sorry I havent managed to look at it yet... been stacked out at work myself. Will try to get around to it tomorrow. Nick

Developer
May 11, 2011 at 10:49 PM

No problem Nick. Take your time...

Developer
May 26, 2011 at 12:36 AM

Hi Nick,

Did you got a chance to look at this and try to repro it ? If nothing else, I'm going to assume it's already fixed as it was the only report of such problem so far and i honestly cant repro it locally.. :( And of course i didn't want to do that if there is indeed a problem.

Andre

Developer
May 30, 2011 at 2:36 PM

Hey Andre,

Sorry for not getting back to you, I have been on holiday for two weeks, I tried to reply on here but codeplex doesnt support android... #codeplexfail

Anyways, I cant repro it, if i remember correctly it was very hard for me to repro - I would close the issue.. If it crops backup I will write down the repro for you.

Cheers, Nick

Developer
Aug 28, 2011 at 1:26 PM

Hey Andrerod - We have steps to reproduce - http://orchard.codeplex.com/discussions/270586

It looks like a duplicate feature name issue Feature - I logged a bug a while ago about it. http://orchard.codeplex.com/workitem/17749

Developer
Sep 2, 2011 at 11:50 AM
Edited Sep 2, 2011 at 11:51 AM

It seems the issue could be solved with editing the Web.config as I've described here: http://orchard.codeplex.com/discussions/270586