Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it work with Umbraco V9 #64

Open
gordonsaxby opened this issue Feb 23, 2022 · 5 comments
Open

Does it work with Umbraco V9 #64

gordonsaxby opened this issue Feb 23, 2022 · 5 comments

Comments

@gordonsaxby
Copy link

gordonsaxby commented Feb 23, 2022

I have installed into an Umbraco v9.3.1 project via Nuget. I created the required classes as described at https://github.com/mattbrailsford/umbraco-authu#configuration

The solution compiles, but an error occurs when I try to run it:

System.Reflection.ReflectionTypeLoadException
HResult=0x80131602
Message=Could not load all types from "Our.Umbraco.AuthU, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" due to LoaderExceptions, skipping:
. System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
. System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
. System.TypeLoadException on Umbraco.Core.Migrations.MigrationPlan: Could not load type 'Umbraco.Core.Migrations.MigrationPlan' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on Umbraco.Core.Migrations.MigrationBase: Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on Umbraco.Core.Migrations.MigrationBase: Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on Umbraco.Core.Migrations.MigrationBase: Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on Umbraco.Core.Migrations.MigrationBase: Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on Umbraco.Core.Composing.IUserComposer: Could not load type 'Umbraco.Core.Composing.IUserComposer' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
. System.TypeLoadException on Umbraco.Core.Composing.IComponent: Could not load type 'Umbraco.Core.Composing.IComponent' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.

Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Could not load file or assembly 'System.Web.Http, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
Could not load type 'Umbraco.Core.Migrations.MigrationPlan' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Umbraco.Core.Migrations.MigrationBase' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Umbraco.Core.Composing.IUserComposer' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Could not load type 'Umbraco.Core.Composing.IComponent' from assembly 'Umbraco.Core, Version=9.3.1.0, Culture=neutral, PublicKeyToken=null'.
Source=Umbraco.Core
StackTrace:
at Umbraco.Cms.Core.Composing.TypeFinder.GetTypesWithFormattedException(Assembly a)
at Umbraco.Cms.Core.Composing.TypeFinder.GetClassesWithBaseType(Type baseType, IEnumerable1 assemblies, Boolean onlyConcreteClasses, Func2 additionalFilter)
at Umbraco.Cms.Core.Composing.TypeFinder.FindClassesOfType(Type assignTypeFrom, IEnumerable1 assemblies, Boolean onlyConcreteClasses) at Umbraco.Extensions.TypeFinderExtensions.FindClassesOfType[T](ITypeFinder typeFinder, IEnumerable1 assemblies, Boolean onlyConcreteClasses)
at Umbraco.Cms.Core.Composing.TypeLoader.<>c__DisplayClass56_01.<GetTypes>b__0() at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternalLocked(Type baseType, Type attributeType, Func1 finder, String action, Boolean cache)
at Umbraco.Cms.Core.Composing.TypeLoader.GetTypesInternal(Type baseType, Type attributeType, Func1 finder, String action, Boolean cache) at Umbraco.Cms.Core.Composing.TypeLoader.GetTypes[T](Boolean cache, IEnumerable1 specificAssemblies)
at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilderExtensions.AddAllCoreCollectionBuilders(IUmbracoBuilder builder)
at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder.AddCoreServices()
at Umbraco.Cms.Core.DependencyInjection.UmbracoBuilder..ctor(IServiceCollection services, IConfiguration config, TypeLoader typeLoader, ILoggerFactory loggerFactory, IProfiler profiler, AppCaches appCaches, IHostingEnvironment hostingEnvironment)
at Umbraco.Extensions.UmbracoBuilderExtensions.AddUmbraco(IServiceCollection services, IWebHostEnvironment webHostEnvironment, IConfiguration config)
at MyWebsite.Startup.ConfigureServices(IServiceCollection services) in C:\Development\Fifth Dimension\MyWebsite\trunk\MyWebsite\MyWebsite\Startup.cs:line 46
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.g__Startup|0(IServiceCollection serviceCollection)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.b__0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass13_0.b__0(HostBuilderContext context, IServiceCollection services)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at MyWebsite.Program.Main(String[] args) in C:\Development\Fifth Dimension\MyWebsite\trunk\MyWebsite\MyWebsite\Program.cs:line 12

@mattbrailsford
Copy link
Owner

AuthU is currently Umbraco v8 and lower only. I haven’t reviewed the current landscape for implementing OAuth in .NET Core so don’t have any idea of whether this pkg is even worth porting. To be honest though, it’s not high on my priority list right now so don’t have an idea of when I’m likely to look into it.

I’m open to a PR / discussion if someone wants to see what is possible.

@gordonsaxby
Copy link
Author

Thanks for letting me know Matt. Unfortunately, I've not used Umbraco v8 and I am very new to v9 and .Net Core, so I'm not sure I'm the best person to investigate. However, I think I have some time over the next couple of days so I will try and have a look (never know, it might be an easy fix!)

@mattbrailsford
Copy link
Owner

Even just looking into .NET Core to see how easy OAuth is on it's own now (I really only created AuthU because OAuth was an absolute nightmare to setup before) as this would highlight whether this package is even necessary or not. 👍

@gordonsaxby
Copy link
Author

Unfortunately, converting this to Umbraco V9 (.Net Core 6) does not appear to be very easy, or within my skillset :-(

@somoreingold
Copy link

I'm definitely interested in this as well; I'm hoping to reconcile this with this tutorial at some point this year: https://jasonwatmore.com/post/2022/01/24/net-6-jwt-authentication-with-refresh-tokens-tutorial-with-example-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants