Aspnetcore.docs: Can't complete this with the instructions here

Created on 23 Oct 2019  Â·  13Comments  Â·  Source: dotnet/AspNetCore.Docs

This page lack a lof of step to complete this.
Is necessary step in another page that is dificult to connect.
Here is fundamental a full example that the read just change provider configuration to take idea
of how this works.

Please, complete it!


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Source - Docs.ms needs-more-info

Most helpful comment

Ok, What you are talking is that it just take the authentication made with the provider and put in cookie.
if yes, now I understand. It just complement (Google, Facebook, Microsoft, etc) example.

What I understand when I read the title was that I would to use providers without Identity (I just configure the providers, no store would''nt necessary)
No EntityFramework to Identity, no database for users, roles and external login.

All 13 comments

image

What is not working? What error do you get?

Is necessary step in another page that is dificult to connect.

This is not a beginning tutorial. You should complete https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/google-logins or similar before attempting this.

The page show three things:

Configuration;
Apply authorization;
Sign out;

a) I make the example to login with cookie. Nice! easy!
b) I make the example with facebook provider. Nice! easy!

But, now I want to use just the external login!
No Identity;
No user store;

So, I have to list the providers to user choese: google, facebook, twitter and etc..
I make a full scafolding on identity (but I want not use the identity)
I see in the register Page how to list the providers configurated:
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();

and in ExternalLogin page:
// Request a redirect to the external login provider. var redirectUrl = Url.Page("./ExternalLogin", pageHandler: "Callback", values: new { returnUrl }); var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); return new ChallengeResult(provider, properties);

How I can do it without using SignInManager?

I return the providers looking on GetExternalAuthenticationSchemesAsync on GitHub:
var schemes = await _schemes.GetAllSchemesAsync(); var providers = schemes.Where(s => !string.IsNullOrEmpty(s.DisplayName)); // var properties = new AuthenticationProperties{ RedirectUri = };

And I need to configure and call the method:
ChallengeResult(provider, properties);

I'm doing it with Razor Page, but I want to do it with Blazor

Have an way to do it ?

cc @serpent5

And I forgot to write.
With the example in this page is not possible to login with social without Identity.
If I not wrong SignInManager is highly coupled with Identity framework, it take in your
constructor a kind of dependency.

And following the sections:
Configuration;
Apply authorization;
Sign out;

To complete I need to login with social media.
And here is the question that I'm trying to argument.
And above I say I'm doing it in Razor Page. What I'm saying is I'm trying!

Because if I need to use the SignInManager I need an IIdentity implementation to
use together with SignInManager, because it take a IIdentity parameter.

But I see that need more things to it to be completed.
:)

You're not using the Identity DB. To sign out, you need to sign out at the provider.

@serpent5 I think we just need to rename this Facebook, Google, and external provider authentication without ASP.NET Core Identity Database

And tell them to sign out at the provider.

No. I'm not using database. And yes the Title would be confusing the intention of the documentation.
What I think that I would be using the providers that I want. And when I authenticate with the provider it made something of controls (like cookie authentication) And I not need a Database.

I take this from the documentation:
This sample demonstrates how to use an external authentication provider without ASP.NET Core Identity. This is useful for apps that don't require all of the features of ASP.NET Core Identity, but still require integration with a trusted external authentication provider.

I think that sentence needs to change.

But, now I'm think, what about this page is talking?

I'm not sure I understand what's being asked here.

a) I make the example to login with cookie. Nice! easy!
b) I make the example with facebook provider. Nice! easy!

That's what the page is about. The sample authenticates using Google, but the same applies for Facebook, etc. Once a user has been authenticated with Google, the app keeps track of the user's information using a cookie.

Here's a few things I see might be being asked about:

  1. We use Cookie authentication to store the user information that was received from Google. Without this, we'd forget this information as soon as the login process finished. There's a link in this page to the specifics of using Cookie authentication, which allows for customization of that process.

  2. Being able to choose which external provider to use, by giving the user a list of registered providers (Google, Facebook, Microsoft, etc). This isn't covered in this page, but it's something that could be considered for addition (if @Rick-Anderson agrees).

  3. What does it mean to sign out? The sign out option in the app ends up removing the cookie that's storing the information received from Google. This is different to signing out of Google.

Being able to choose which external provider to use, by giving the user a list of registered providers (Google, Facebook, Microsoft, etc).

That's a low priority. Developers should be able to use this example to add other providers.

Ok, What you are talking is that it just take the authentication made with the provider and put in cookie.
if yes, now I understand. It just complement (Google, Facebook, Microsoft, etc) example.

What I understand when I read the title was that I would to use providers without Identity (I just configure the providers, no store would''nt necessary)
No EntityFramework to Identity, no database for users, roles and external login.

Was this page helpful?
0 / 5 - 0 ratings