The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

daveharney (15) [Avatar] Offline
A pretty easy chapter and I got a good understanding of how Identity works. However, one topic that still confuses me is the “returnUrl” that is used heavily in the Account and Manage controllers. Following the use of this string with the debugger didn’t provide much insight. For example, if I use the default template and logon while in the Contact page, I don’t return to that page after being logged on. The returnUrl string always seems to be null? Some insight would be appreciated.

Adding Identity to an existing project is definitely complicated and time consuming. However, the tutorial here does make it workable. The trick of creating a temp project with the same name is a great idea! A couple of observations:

- Copying the temp project code is best done from the File Explorer – not Visual Studio.

- I had to delete the ApplicationUser from Models and put it in Data to conform with the author’s Recipe sample project.

- _ViewImports needs the Data Using line (now in the sample code)

- Page 435 perhaps remind that DB Update is also needed after the migration

- The Account and Manage controllers need to be tweaked for returning to the Recipe index page after each method.
Andrew Lock (51) [Avatar] Offline
Hi Dave,

You might find that the ReturnUrl makes more sense after chapter 15. It is typically used when a page is requested that you need to be logged in to access. For example, click the "Create Recipe" button when not logged in on chapter 15, and you'll see the current page is passed in the returnUrl parameter. Now, it would be perfectly possible to set the returnUrl based on the page you're on, that's just not the way the templates work smilie

Thanks for the notes on your expereince - I'll make sure to add clarification where necessary smilie

514615 (4) [Avatar] Offline
Oauth2 and jwt
Will be Google/Facebook/github... and custom oauth2 and jwt
Will be explained?
Andrew Lock (51) [Avatar] Offline

No, I don't go into those aspects in this book. There are sever tutorials you can use if you're interested in that aspect. For example, you can see the documentation here:

I also wrote several posts on this. These use ASP.NET Core 1.X, but much of it is application to ASP.NET Core 2.0 too:

Hope that helps