IdentityEndpointsSample icon indicating copy to clipboard operation
IdentityEndpointsSample copied to clipboard

Angular sample client app

Open kjartanvalur opened this issue 2 years ago • 10 comments

Added an Angular sample app that tests all features

kjartanvalur avatar Jul 21 '23 08:07 kjartanvalur

Needed to add CORS config to allow the angular client to call the api. But somehow not all code came through yesterday. Added the code now. Thanks @davidfowl for this repo.

kjartanvalur avatar Jul 22 '23 07:07 kjartanvalur

image

kjartanvalur avatar Jul 22 '23 07:07 kjartanvalur

@davidfowl Is this something you would consider merging? I can see other sample clients being added here in the future. And implement Two Factor Authentication when that comes out in the next Preview version of Dotnet8

kjartanvalur avatar Jul 24 '23 08:07 kjartanvalur

Yep I’ll merge it. I’d like to make sure we can support a react sample as well though

davidfowl avatar Jul 24 '23 15:07 davidfowl

@davidfowl I merged with the latest base branch. It´s really easy to add another client later like React. I added this into an Clients folder.

kjartanvalur avatar Jul 26 '23 08:07 kjartanvalur

@davidfowl Any changes you would like to see?

kjartanvalur avatar Jul 31 '23 09:07 kjartanvalur

I updated to Preview 7 the register page to support email and username

kjartanvalur avatar Aug 09 '23 09:08 kjartanvalur

@davidfowl Can you point me in the right direction to enable two-factor authentication now that Preview 7 is out? Is it possible to enforce two-factor auth or is it only an opt-in feature for the user with a specific update function that updates the users table? Is it possible to catch when the user calls the register API (or any other) and do something else in the process?

kjartanvalur avatar Aug 09 '23 10:08 kjartanvalur

cc @halter73

davidfowl avatar Aug 29 '23 04:08 davidfowl

Is it possible to enforce two-factor auth or is it only an opt-in feature for the user with a specific update function that updates the users table? Is it possible to catch when the user calls the register API (or any other) and do something else in the process?

Right now, the user needs to opt into 2fa, but you can configure an authorization policy that requires the TwoFactorEnabled claim to be true using an authorization policy. See https://stackoverflow.com/questions/68920518/how-to-enforce-2fa-in-my-net-core-identity-web-app.

I don't think there's a good way to make login fail until 2fa is configured though. This is also a problem with Identity UI, but that's easier to scaffold and customize.

halter73 avatar Aug 29 '23 15:08 halter73