OpenIdDict 2 (16.12.2022 M) Flashcards

1
Q

What does AddCore make and why do you need to call options.UseEntityFrameworkCore()
.UseDbContext<DbContext>();</DbContext>

A

AddCore registers core services, for example, managers and store resolvers of the Application, Authorization, Scopes, and Token entities.
So the aim of the Core is to provide access to and management of Application, Authorization, Scopes, and Token entities.

You need to call UseEntityFrameworkCore to register stores that will be resolved by resolvers (you add EF implementation of stores).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are ephemeral keys?

A

You can use ephemeral keys for encrypting or signing tokens

Ephemeral keys are automatically discarded when the application shuts down and payloads signed or encrypted using these keys are therefore automatically invalidated. This method should only be used during development.

On production, using a X.509 certificate is recommended

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does AddServer make?

A

OpenIdDict is implemented with the Mediator pattern.

So AddServer registers the dispatcher and a bunch of default handlers, which implement main business logic, like handling the validation of OAuth + OpenId endpoints requests, preparing responses for them, etc.

AddServer allows configuring of server behavior and data. For example, you can add scopes here, set issuer host, set up keys for encryption and digital signature, and set up endpoints URLs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What UseAspNetCore does do inside AddServer?

A

AddServer registers like business logic, when UseAspNetCore connects it with the AspNetCore pipeline.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What middleware does UseAspNetCore use for integration to the pipeline?

A

It uses Authentication middleware. It means that to make OpenIdDict work you have to call UseAuthentication between UseRouting and UseEndpoints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly