Browse Source

Update README.md

pull/257/head
Kévin Chalet 9 years ago
parent
commit
5589a8cc44
  1. 13
      README.md
  2. 4
      samples/Mvc.Server/Startup.cs

13
README.md

@ -50,7 +50,8 @@ To use OpenIddict, you need to:
```json ```json
"dependencies": { "dependencies": {
"AspNet.Security.OAuth.Validation": "1.0.0-alpha2-final", "AspNet.Security.OAuth.Validation": "1.0.0-alpha2-final",
"OpenIddict": "1.0.0-*" "OpenIddict": "1.0.0-*",
"OpenIddict.Mvc": "1.0.0-*"
} }
``` ```
@ -70,6 +71,11 @@ public void ConfigureServices(IServiceCollection services) {
// Register the OpenIddict services, including the default Entity Framework stores. // Register the OpenIddict services, including the default Entity Framework stores.
services.AddOpenIddict<ApplicationDbContext>() services.AddOpenIddict<ApplicationDbContext>()
// Register the ASP.NET Core MVC binder used by OpenIddict.
// Note: if you don't call this method, you won't be able to
// bind OpenIdConnectRequest or OpenIdConnectResponse parameters.
.AddMvcBinders()
// Enable the token endpoint (required to use the password flow). // Enable the token endpoint (required to use the password flow).
.EnableTokenEndpoint("/connect/token") .EnableTokenEndpoint("/connect/token")
@ -135,6 +141,11 @@ The **Mvc.Server sample comes with an [`AuthorizationController` that supports b
public void ConfigureServices(IServiceCollection services) { public void ConfigureServices(IServiceCollection services) {
// Register the OpenIddict services, including the default Entity Framework stores. // Register the OpenIddict services, including the default Entity Framework stores.
services.AddOpenIddict<ApplicationDbContext>() services.AddOpenIddict<ApplicationDbContext>()
// Register the ASP.NET Core MVC binder used by OpenIddict.
// Note: if you don't call this method, you won't be able to
// bind OpenIdConnectRequest or OpenIdConnectResponse parameters.
.AddMvcBinders()
// Enable the authorization and token endpoints (required to use the code flow). // Enable the authorization and token endpoints (required to use the code flow).
.EnableAuthorizationEndpoint("/connect/authorize") .EnableAuthorizationEndpoint("/connect/authorize")
.EnableTokenEndpoint("/connect/token") .EnableTokenEndpoint("/connect/token")

4
samples/Mvc.Server/Startup.cs

@ -62,13 +62,13 @@ namespace Mvc.Server {
// You can generate a self-signed certificate using Pluralsight's self-cert utility: // You can generate a self-signed certificate using Pluralsight's self-cert utility:
// https://s3.amazonaws.com/pluralsight-free/keith-brown/samples/SelfCert.zip // https://s3.amazonaws.com/pluralsight-free/keith-brown/samples/SelfCert.zip
// //
// services.AddOpenIddict<ApplicationUser, IdentityRole<Guid>, ApplicationDbContext, Guid>() // services.AddOpenIddict<ApplicationDbContext>()
// .AddSigningCertificate("7D2A741FE34CC2C7369237A5F2078988E17A6A75"); // .AddSigningCertificate("7D2A741FE34CC2C7369237A5F2078988E17A6A75");
// //
// Alternatively, you can also store the certificate as an embedded .pfx resource // Alternatively, you can also store the certificate as an embedded .pfx resource
// directly in this assembly or in a file published alongside this project: // directly in this assembly or in a file published alongside this project:
// //
// services.AddOpenIddict<ApplicationUser, IdentityRole<Guid>, ApplicationDbContext, Guid>() // services.AddOpenIddict<ApplicationDbContext>()
// .AddSigningCertificate( // .AddSigningCertificate(
// assembly: typeof(Startup).GetTypeInfo().Assembly, // assembly: typeof(Startup).GetTypeInfo().Assembly,
// resource: "Mvc.Server.Certificate.pfx", // resource: "Mvc.Server.Certificate.pfx",

Loading…
Cancel
Save