Kbalz
Kbalz

Reputation: 101

WebApi2 + OWIN, no authentication store

I am prototyping a project from home, and I'd like to have my application authenticate credentials against some hard coded values in my code.

Can anyone give me a little direction on how I might do that? Will I need to implement some ASP Identity Core methods to do this?

My client is a simple angularjs app, the webapi2 is self hosted.

Most examples I see using owin tap into entity frame work, or windows azure active directory. Once my project is approved and gets moved into our dev environment, it will authenticate using organizational accounts via ADFS.. but at this point i'm still prototyping from home, offsite proof of concepting. I'd like to work out the login piece as much as possible. Thanks!

Upvotes: 2

Views: 112

Answers (1)

Xavier Egea
Xavier Egea

Reputation: 4763

I recommend you to follow some of these examples about ASP.NET Identity that you stated that usually work using Entity Framework creating a local Database. This way you will be able to work from home (even off-line if you wish).

Then you would be able to register a new user locally and work authenticated with that user.

As you have noticed, there are a several project templates to create a project with ASP.NET Identity with all the scaffold for controllers, views and so one. I'd recommend you to use them and don't try to fight against them if you don't want to worry about authentication neither authorization issues.

Note: What makes you to be logged when you perform an action is the [Authorize] attribute in your controllers or actions. If you delete them you will be able to call these actions/methods without beign authenticated. So you can do it if you wish to work without beign logged.

Upvotes: 1

Related Questions