IdentityManager / IdentityManager.AspNetIdentity

ASP.NET Identity support for Thinktecture IdentityManager
Apache License 2.0
60 stars 51 forks source link

Unable to access GUI #16

Closed Trapulo closed 9 years ago

Trapulo commented 9 years ago

Calling /idm I get an 404 error, and url has been changed to

http://localhost:61581/idm/authorize?state=29981995698981714&client_id=idmgr&response_type=token

brockallen commented 9 years ago

This is not much info to go on.

Trapulo commented 9 years ago

What kind of info can I add? I call http://localhost:61581/idm/ Then I'm redirect to: http://localhost:61581/idm/authorize?state=11902375240026318&client_id=idmgr&response_type=token and the page response is a 404 The resource cannot be found. (maybe a fake 404 created by a runtime error, I don't know).

my setup: app.Map("/idm", Sub(idm)

                        Dim factory = New IdentityManager.Configuration.IdentityManagerServiceFactory
                        factory.IdentityManagerService = New Registration(Of IIdentityManagerService)(Function(resolver)
                                                                                                          Dim userManager = New UserManager(Of Microsoft.AspNet.Identity.EntityFramework.IdentityUser)(New UserStore(Of Microsoft.AspNet.Identity.EntityFramework.IdentityUser))
                                                                                                          Dim roleManager = New RoleManager(Of IdentityRole)(New RoleStore(Of IdentityRole)())
                                                                                                          Return New AspNetIdentityManagerService(Of IdentityUser, String, IdentityRole, String)(userManager, roleManager)
                                                                                                      End Function)
  Factory.Register(New Registration(Of ApplicationUserManager)())
                        idm.UseIdentityManager(New IdentityManagerOptions() With {.Factory = factory, .DisableUserInterface = False})

                    End Sub
 )

Also tried cloning the online sample (that, "as is", works well):

<Assembly: OwinStartupAttribute(GetType(Startup))>

Partial Public Class Startup Public Sub Configuration(app As IAppBuilder) ConfigureAuth(app)

    Logger.SetLogWriter(New LogWriterFactory().Create())
    app.Map("/idm", Sub(idm)
                        Dim factory = New IdentityManagerServiceFactory()
                        factory.IdentityManagerService = New Registration(Of IIdentityManagerService, ApplicationIdentityManagerService)()
                        factory.Register(New Registration(Of ApplicationUserManager)())
                        factory.Register(New Registration(Of ApplicationUserStore)())
                        factory.Register(New Registration(Of ApplicationRoleManager)())
                        factory.Register(New Registration(Of ApplicationRoleStore)())
                        'factory.Register(new Registration<ApplicationDbContext>(resolver => new ApplicationDbContext("foo")));
                        factory.Register(New Registration(Of ApplicationDbContext)())

                        idm.UseIdentityManager(New IdentityManagerOptions() With {.Factory = factory})

                    End Sub)
End Sub

End Class

Public Class ApplicationUserStore Inherits UserStore(Of ApplicationUser) Public Sub New(ctx As ApplicationDbContext) MyBase.New(ctx) End Sub End Class

Public Class ApplicationRoleStore Inherits RoleStore(Of IdentityRole) Public Sub New(ctx As ApplicationDbContext) MyBase.New(ctx) End Sub End Class

Public Class ApplicationRoleManager Inherits RoleManager(Of IdentityRole) Public Sub New(roleStore As ApplicationRoleStore) MyBase.New(roleStore) End Sub End Class

Public Class ApplicationIdentityManagerService Inherits AspNetIdentityManagerService(Of ApplicationUser, String, IdentityRole, String) Public Sub New(userMgr As ApplicationUserManager, roleMgr As ApplicationRoleManager) MyBase.New(userMgr, roleMgr) End Sub End Class

BTW without Logger.SetLogWriter(New LogWriterFactory().Create()) I've a runtime error

brockallen commented 9 years ago

Do you have RAMMAR enabled?

Trapulo commented 9 years ago

What? :)

brockallen commented 9 years ago

http://lmgtfy.com?q=RAMMFAR :)

brockallen commented 9 years ago

You can also read more of the docs here: https://github.com/IdentityManager/IdentityManager/wiki/Installing-and-Hosting

Trapulo commented 9 years ago

sure I've runAllManagedModulesForAllRequests on...

brockallen commented 9 years ago

Are you running over HTTPS? If not, then you need to configure IdentityManagerOptions.RequireSsl

Trapulo commented 9 years ago

got it! it was the HTTP (not S)... I suggest to clear this in the wiki :) Now the GUI starts. It doesn't work (operations will fail), but I think this will be some trouble with asp.net identity integration option..

brockallen commented 9 years ago

Ok, good to hear that you're making progress :)

valeriob commented 9 years ago

That took me a while, cheers @Trapulo !