JMan
JMan

Reputation: 2629

IdentityServer4 OpenIdConnectAuthentication or IdentityServerAuthentication

When configuring IdentityServer4 for ASP WebAPI/MVC i have the option to use

It seems to me that it does the same thing. Why shouldi choose the Identity server option over the openidconnect?

When does each one apply best and why?

Upvotes: 0

Views: 468

Answers (2)

Michael Freidgeim
Michael Freidgeim

Reputation: 28435

In API (MVC Web API) application you should call

app.UseIdentityServerAuthentication

See IdentityServer4 API documentation

Our authentication middleware serves the same purpose as the app.UseJwtBearerAuthentication middleware (in fact it uses the Microsoft JWT middleware internally), but adds a couple of additional features:

  • support for both JWTs and reference tokens
  • extensible caching for reference tokens
  • unified configuration model
  • scope validation

In Web Client (MVC Web ) you should call

app.UseOpenIdConnectAuthentication

See IdentityServer4 "Creating an MVC client" documentation

Upvotes: 1

KJBTech
KJBTech

Reputation: 1971

app.UseOpenIdConnectAuthentication

It implement a middlware to use the OIC flow whatever your server authority.

Have a look on those links :

app.UseIdentityServerAuthentication

In this case, the configuration is more specific to use the IdendityServer4 workflow

Difference ?

The first is more generic whereas the second is more specific.

Upvotes: 0

Related Questions