title: Microsoft Bot Framework, Login with Office 365
body: <p>I am new in this Bot Framework, I have failed to find enough help on the internet regarding login 365 Authentication. </p>
  
  <p>I have developed a simple Card ordering Bot, Now I need to authenticate it with Office365 account. I have followed this AuthDemo (<a href="https://github.com/tsmatsuz/AuthDemoBot" rel="nofollow">https://github.com/tsmatsuz/AuthDemoBot</a>) </p>
  
  <p>After clicking Connect on Emulator I have this link :</p>
  
  <p><a href="https://login.microsoftonline.com/common/oauth2/authorize?resource=https:%2F%2Foutlook.office365.com%2F&amp;client_id=18ab0821-0bbc-4d05-9f65-a30e34f3faa3&amp;response_type=code&amp;haschrome=1&amp;redirect_uri=https:%2F%2Fauthdemoweb.azurewebsites.net%2FHome%2FAuthorize&amp;x-client-SKU=PCL.Desktop&amp;x-client-Ver=3.13.4.878&amp;x-client-CPU=x64&amp;x-client-OS=Microsoft+Windows+NT+6.2.9200.0" rel="nofollow">https://login.microsoftonline.com/common/oauth2/authorize?resource=https:%2F%2Foutlook.office365.com%2F&amp;client_id=18ab0821-0bbc-4d05-9f65-a30e34f3faa3&amp;response_type=code&amp;haschrome=1&amp;redirect_uri=https:%2F%2Fauthdemoweb.azurewebsites.net%2FHome%2FAuthorize&amp;x-client-SKU=PCL.Desktop&amp;x-client-Ver=3.13.4.878&amp;x-client-CPU=x64&amp;x-client-OS=Microsoft+Windows+NT+6.2.9200.0</a></p>
  
  <p>Which crashes.</p>
  
  <p>Regarding our application</p>
  
  <ol>
  <li>I have created an app on <a href="https://apps.dev.microsoft.com/#/appList" rel="nofollow">https://apps.dev.microsoft.com/#/appList</a>
  AppID :     df0a8a77-708e-443b-88af-41eb6bXXXXXXX</li>
  <li>I have added this appID in webConfig of our project.</li>
  <li>My BOT is not yet approved and we dont have <strong>BOTID</strong> and
  <strong>BOTSECRET</strong>.</li>
  <li>I have hosted my BOT Code and Login API on our server with SSL
  implementation. (Code is copied from AuthDemo but Keys are changed)</li>
  </ol>
  
  <p>When I run My code on IIS, It make a link <a href="https://msbot.devbatch.com/web/Home/Login?userid=2c1c7fa3" rel="nofollow">https://msbot.devbatch.com/web/Home/Login?userid=2c1c7fa3</a>
  And I get this error :</p>
  
  <blockquote>
    <p>Sign In</p>
    
    <p>Sorry, but we’re having trouble signing you in. We received a bad
    request. Additional technical information: Correlation ID:
    a462bfbb-c932-4078-bf8b-b3bbe9dbd78e Timestamp: 2016-10-25 05:36:11Z
    AADSTS65005: The client application has requested access to resource
    '<a href="https://outlook.office365.com/" rel="nofollow">https://outlook.office365.com/</a>'. This request has failed because the
    client has not specified this resource in its requiredResourceAccess
    list.</p>
  </blockquote>
  
  <p>I need complete configuration/Steps on Sign in via Office365.</p>