title: .AddOAuth() vs .AddOpenIdConnect()
body: <p>People,</p>
  
  <p>Can you clarify for me what difference and purpose is of these two methods:</p>
  
  <ol>
  <li>Microsoft.Extensions.DependencyInjection.OAuthExtensions.AddOAuth();</li>
  <li>Microsoft.Extensions.DependencyInjection.OpenIdConnectExtensions.AddOpenIdConnect().</li>
  </ol>
  
  <p>According to name one is used to authorize, another to authenticate user, right?
  So if my mvc application needs to know who user is I need to use <code>.AddOpenIdConnect()</code> to fetch <code>id_token</code>? And if I need to call resource service from mvc application on behalf of current user I need to add <code>.AddOAuth()</code> to get <code>access_token</code>?</p>
  
  <p>Experiments with auth0.com showed that code with <code>.AddOAuth()</code> is able to get access token as result of <code>HttpContext.GetTokenAsync("access_token")</code>, but nothing if <code>HttpContext.GetTokenAsync("id_token")</code>.</p>
  
  <p>And visa versa - <code>.AddOpenIdConnect()</code> can get id_token, but no access_token.</p>
  
  <p>Configuration for both is equal:</p>
  
  <pre><code>.AddOAuth("oauth", o =&gt;
              {
                  o.AuthorizationEndpoint = "https://&lt;Realm&gt;.auth0.com/authorize?audience=resourceAPI-server";
                  o.TokenEndpoint = "https://&lt;REALM&gt;.auth0.com/oauth/token";
                  o.ClientId = "&lt;clientID&gt;";
                  o.ClientSecret = "&lt;secret&gt;";
                  o.CallbackPath = "/cb_oauth";
                  o.SaveTokens = true;
  
              })
              .AddOpenIdConnect("openIdConnect", o =&gt;
              {
                  o.Authority = "https://&lt;REALM&gt;.auth0.com";
                  o.ClientId = "&lt;clientID&gt;";
                  o.ClientSecret = "&lt;secret&gt;";
                  o.CallbackPath = "/cb_openIdConnect";
                  o.SaveTokens = true;
                  o.Events =new OpenIdConnectEvents()
                  {
                      OnRedirectToIdentityProvider = rc =&gt;
                      {
                          rc.ProtocolMessage.SetParameter("audience","resourceAPI-server");
                          return Task.CompletedTask;
                      }
                  };
              })
  </code></pre>
  
  <p>It is really strange, as I can get both tokens (access and id) in postman with code flow and scope <code>openid email profile</code>.</p>
  
  <p>Also tutorials on auth0.com show that .AddOpenIdConnect() with additional scope can get access token as well.
  Very confusing.</p>
  
  <p>So, which one for what case?</p>