title: How do I expose ASP.NET Core Identify to Swagger
body: <p>I have setup a asp.net core Web API 2 project with authorisation and when I migrated my Entity Framework code first it created the <code>AspNetUsers</code>. I have now added my swagger doc to the site but their is no methods to register a user etc how do I register the asp.net Identity methods to register a user verify a user etc to the swagger site.</p>
  <p>Do I need to create my own <code>AccountController</code>? Or is there a way to expose those methods to swagger?</p>
  <pre><code>services.AddSwaggerGen(c =&gt; {
  c.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo { Title = &quot;App Manager - Running Buddies&quot;, Version = &quot;v1&quot; });
  
  //Expose XML comments in doc.
  c.AddSecurityDefinition(&quot;Bearer&quot;, new OpenApiSecurityScheme {
                  Description =
                  &quot;JWT Authorization header using the Bearer scheme. \r\n\r\n Enter 'Bearer' [space] and then your token in the text input below.\r\n\r\nExample: \&quot;Bearer 12345abcdef\&quot;&quot;,
                  Name = &quot;Authorization&quot;,
                  In = ParameterLocation.Header,
                  Type = SecuritySchemeType.ApiKey,
                  Scheme = &quot;Bearer&quot;
              });
  
              c.AddSecurityRequirement(new OpenApiSecurityRequirement()
              {
           {
               new OpenApiSecurityScheme
               {
                 Reference = new OpenApiReference
                {
                 Type = ReferenceType.SecurityScheme,
                  Id = &quot;Bearer&quot;
                },
                Scheme = &quot;oauth2&quot;,
                Name = &quot;Bearer&quot;,
                In = ParameterLocation.Header
             },
             new List&lt;string&gt;()
           }
         });
  
   });
  </code></pre>
  <p><a href="https://i.stack.imgur.com/PW9b0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PW9b0.png" alt="enter image description here" /></a></p>