Skip to content

Update to ASP.NET Core 2.0 #7

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

Open
KeithT opened this issue Aug 25, 2017 · 6 comments
Open

Update to ASP.NET Core 2.0 #7

KeithT opened this issue Aug 25, 2017 · 6 comments

Comments

@KeithT
Copy link

KeithT commented Aug 25, 2017

Just completed (nearly all) your Lynda course (which is excellent by the way) following along using Core 2. I thought you might be interested in a couple of things that break:

In Startup.cs:

        // Add ASP.NET Core Identity
            services.AddIdentity<UserEntity, UserRoleEntity>()
                .AddEntityFrameworkStores<HotelApiContext, Guid>()
                .AddDefaultTokenProviders();

needs to go to:

        // Add ASP.NET Core Identity
            services.AddIdentity<UserEntity, UserRoleEntity>()
                .AddEntityFrameworkStores<HotelApiContext>()
                .AddDefaultTokenProviders();

and in the UsersController.cs:

                var canSeeEveryone = await _authzService
                    .AuthorizeAsync(User, "ViewAllUsersPolicy");
                if (canSeeEveryone)
                {
                    users = await _userService.GetUsersAsync(
                        pagingOptions, sortOptions, searchOptions, ct);
                }

Error CS0029 Cannot implicitly convert type 'Microsoft.AspNetCore.Authorization.AuthorizationResult' to 'bool' bodimecore ...\Controllers\UsersController.cs error

Which I've not had time to look at yet. (Monday hopefully).
Thanks again for the great course.

@nbarbettini
Copy link
Owner

Thanks for watching the course! I'm glad it was helpful.

I need to update this repo (and the course eventually) to all the Core 2.0 packages. I just haven't had time yet. Thanks for the reminder. 👍

@nbarbettini nbarbettini changed the title Core 2 Breakages Update to ASP.NET Core 2.0 Aug 25, 2017
@KeithT
Copy link
Author

KeithT commented Aug 28, 2017

I've not been able to get the authentication part working, there seems to be significant changes in Core 2 in this area: aspnet/Announcements#232.

Blocked by: Could not load type 'Microsoft.AspNetCore.Builder.AuthenticationOptions' from assembly 'Microsoft.AspNetCore.Authentication in Startup at

app.UseOAuthValidation(); app.UseOpenIddict();

I've tried different package versions of things e.g. tried upgrading OpenIddict, downgrading System.IdentityModel.Tokens.Jwt with no luck

Any pointers greatly appreciated.

@EthernetIp
Copy link

Although a new course that I just watched, Its great btw. The authentication section, that was my only issue to start with, is already obsolete.
Can you PLEASE, update it to Core 2, and maybe show the hash method as well as identity.

@nbarbettini
Copy link
Owner

Updates are a little delayed but definitely coming.

What's the hash method you mentioned?

@EthernetIp
Copy link

EthernetIp commented Oct 20, 2017

Digest authentication , MD5 hashing I guess.

Tx in advance.

@SeanFarrow
Copy link

Hi,

this looks really good. Have you started to update this to core/net standard 2.0? If not I'm happy to do this and submit a pr, if that would help?

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

4 participants