cloudscribe / cloudscribe.SimpleContent

A simple, yet flexible content and blog engine for ASP.NET Core that can work with or without a database, supports markdown or html editing
https://www.cloudscribe.com/docs/cloudscribe-simplecontent
Apache License 2.0
334 stars 65 forks source link

Login not working #159

Closed dodyg closed 7 years ago

dodyg commented 7 years ago

I do a dotnet run on example.WebApp and the site boots up on 60000 and 60002. I try to login using demo@demo.com and admin but it does not work although the settings clearly show the user


  {
                "UniqueKey": "tenant1",
                "SiteName": "SimpleContent Demo",
                "Hostnames": [
                    "localhost:60000",
                    "localhost:53941",
                    "localhost:44348",
                    "tenant1.local:60000"
                ],
                "Theme": "default",
                "ContentProjectId": "project1",
                "EnablePasswordHasherUi": "true",
                "RecaptchaPublicKey": "",
                "RecaptchaPrivateKey": "",
                "AuthenticationScheme": "tenant1",
                "Users": [ 
                    {
                        "UserName": "admin",
                        "FYI-Comment": "this hash is a hash of the word admin, to create your own password hash, set EnablePasswordHasherUi as true, and visit /Login/HashPassword",
                        "Password": "AQAAAAEAACcQAAAAEKyu1zRJBNHJUw4r1mJwxgHfvofBmIAZSiG8X1O8dmdBFiQT0183/oqeoo0qGHv/Hw==",
                        "PasswordIsHashed": "true",
                        "Claims": [
                            {
                                "ClaimType": "ProjectId",
                                "ClaimValue": "project1"
                            },
                            {
                                "ClaimType": "DisplayName",
                                "ClaimValue": "Bilbo Baggins"
                            },
                            {
                                "ClaimType": "Email",
                                "ClaimValue": "demo@demo.com"
                            },
                            {
                                "ClaimType": "Role",
                                "ClaimValue": "Admins"
                            }

                        ]
                    },
                    {
                        "UserName": "member",
                        "Password": "member",
                        "PasswordIsHashed": "false",
                        "Claims": [
                            {
                                "ClaimType": "DisplayName",
                                "ClaimValue": "Mr Awesome"
                            },
                            {
                                "ClaimType": "Email",
                                "ClaimValue": "demo2@demo.com"
                            },
                            {
                                "ClaimType": "Role",
                                "ClaimValue": "Members"
                            }

                        ]
                    }
                ]
            }```
joeaudette commented 7 years ago

In that sample with simple auth you are supposed login with username not email, ie use admin as both username and password

dodyg commented 7 years ago

I tried that but remember you put an email validation on the login.

joeaudette commented 7 years ago

I think I figured out you are using the actual source code in this repository, I thought you were using this starterkit

In this repo that config file is not currently used, it was used long ago, but currently the example.WebApp uses cloudscribe Core for authentication whereas that config file is for cloudscribe SimpleAuth which is not wired up now. To login to example.WebApp in this repo use admin@admin.com/admin

However I recommend use one of the starterkits for starting your project, this repo is for development of SimpleContent, it is not meant for use to start a project.

This starterkit uses the config file for users with cloudscribe SimpleAuth

dodyg commented 7 years ago

Ah ok. Thanks.