title: Microsoft Graph - Create outlook/teams meeting as a application .Net/C#
body: <p>I'm trying to create a meeting as a application, add attendees, determine time availability.</p>
  <p>This is what I have so far :</p>
  <p><strong>Auth</strong></p>
  <pre><code>private async Task&lt;ClientCredentialProvider&gt; GetToken()
  {
      var confidentialClientApplication = ConfidentialClientApplicationBuilder
          .Create(_microsoftAppId)
          .WithTenantId(_microsoftTenantId)
          .WithClientSecret(_microsoftAppPassword)
          .Build();
  
      ClientCredentialProvider authProvider = new ClientCredentialProvider(confidentialClientApplication);
      return authProvider;
  }
      
  </code></pre>
  <p><strong>Meeting request</strong></p>
  <pre><code>public async Task GetMeetingtime()
  {
      var authProvider = await GetToken();
      GraphServiceClient graphClient = new GraphServiceClient(authProvider);
  
      var attendees = new List&lt;AttendeeBase&gt;()
      {
          new AttendeeBase
          {
              Type = AttendeeType.Required,
              EmailAddress = new EmailAddress
              {
                  Name = &quot;john doe&quot;,
                  Address = &quot;john.doe@onmicrosoft.com&quot;
              }
          },
  
          new AttendeeBase
          {
              Type = AttendeeType.Required,
              EmailAddress = new EmailAddress
              {
                  Name = &quot;john toe&quot;,
                  Address = &quot;john.toe@onmicrosoft.com&quot;
              }
          }
      };
  
  
      var locationConstraint = new LocationConstraint
      {
          IsRequired = false,
          SuggestLocation = false,
          Locations = new List&lt;LocationConstraintItem&gt;()
          {
              new LocationConstraintItem
              {
                  ResolveAvailability = false,
                  DisplayName = &quot;Conf room Hood&quot;
              }
          }
      };
  
  
      var timeConstraint = new TimeConstraint
      {
          ActivityDomain = ActivityDomain.Work,
          TimeSlots = new List&lt;TimeSlot&gt;()
          {
              new TimeSlot
              {
                  Start = new DateTimeTimeZone
                  {
                      DateTime = &quot;2020-12-10T09:00:00&quot;,
                      TimeZone = &quot;Pacific Standard Time&quot;
                  },
                  End = new DateTimeTimeZone
                  {
                      DateTime = &quot;2020-12-10T17:00:00&quot;,
                      TimeZone = &quot;Pacific Standard Time&quot;
                  }
              }
          }
      };
  
      var isOrganizerOptional = false;
  
      var meetingDuration = new Duration(&quot;PT1H&quot;);
  
      var returnSuggestionReasons = true;
  
      var minimumAttendeePercentage = (double)100;
  
      await graphClient
          .Me
          .FindMeetingTimes(attendees, locationConstraint, timeConstraint, meetingDuration, null, isOrganizerOptional, returnSuggestionReasons, minimumAttendeePercentage)
          .Request()
          .Header(&quot;Prefer&quot;, &quot;outlook.timezone=\&quot;Pacific Standard Time\&quot;&quot;)
          .PostAsync();
  }
  </code></pre>
  <p>This is the error I get:</p>
  <p><code>Current authenticated context is not valid for this request. This occurs when a request is made to an endpoint that requires user sign-in. For example, /me requires a signed-in user.  Acquire a token on behalf of a user to make requests to these endpoints.  Use the OAuth 2.0 authorization code flow for mobile and native apps and the OAuth 2.0 implicit flow for single-page web apps.</code></p>
  <p>How can I solve this?</p>