Read trending IT updates for cloud businesses, managed service providers, IT pros & what innovation digital transformation is driving in tech industry.

Bot Authentication utilizing GitHub because the Id Supplier

0 19


This put up describes easy methods to add OAuth2 authentication to a bot so it may carry out sure GitHub operations on behalf of the consumer. The article assumes that you have already got a bot deployed in Azure. GitHub is used because the id supplier to authenticate the consumer and to generate a bearer token which the bot makes use of to carry out GitHub operations on behalf of the consumer. In its easiest kind, the bot ought to enable the consumer to carry out fundamental GitHub instructions like itemizing and accessing repositories.

You may obtain an instance from GitHub right here. This instance will not be maintained. Use it as a place to begin.

Create a GitHub OAuth utility

  1. In your browser, log in to your GitHub account.
  2. Navigate to GitHub Apps.
  3. Within the left pane, click on the OAuth Apps hyperlink.
  4. Click on the New OAuth App button.
  5. Verify your password.
  6. Enter the next data:
    1. Software title. That is the title of the applying.
    2. HomePage URL. https://dev.botframework.com.
    3. Software description. The intent of the applying.
    4. Authorization callback URL. https://token.botframework.com/internet/redirect.
  7. Click on the Register utility button.
  8. Add a emblem.
  9. Click on the Replace utility button.
  10. Copy and save the Consumer Id and the Consumer Secret. You have to them when setting the bot OAuth connection string in Azure.

Create an authentication connection

  1. In your browser, navigate to the Azure portal.
  2. Choose your bot registration useful resource.
  3.  Click on Settings, within the left pane,
  4.  Scroll to the underside of web page, in the precise pane.
  5. Click on the Add Settings button, within the OAuth Connection Settings part,
  6. Enter the next data:
    1. Title. The title of the connection.
    2. Service Supplier. From the drop-down checklist, choose GitHub.
    3. Consumer Id. The GitHub OAuth utility Consumer Id.
    4. Consumer Secret . The GitHub OAuth utility Consumer Secret.
    5. Scopes. A comma-separated checklist of GitHub instructions, for instance: learn:consumer, consumer:e-mail, repo.
  7. Click on the Save button.

Check the Connection

  1. Click on on the title of the connection you simply created.
  2. Within the displayed connection web page, click on the Check Connection button within the higher proper.
  3. In case you are not signed in GitHub, you may be requested to take action.
  4. As soon as signed in, you ought to be getting your authentication bearer token.

Check the bot

  1. In your browser, navigate to the Azure portal.
  2. Choose your bot registration useful resource.
  3. Within the left pane, click on Check in Net Chat.
  4. Within the instance proven right here, you obtain a welcome message.
  5. Enter any message within the textual content field. You may be requested to sign up.
  6. Click on the Signal In button.
  7. As soon as signed in efficiently, the bot shows a set of GitHub instructions you need to use, as proven within the image under.
  8. Should you click on the Repositories button, you get the checklist of the GitHub repository you’ll be able to entry. And you will get to these repositories in GitHub.


You might also like