Skip to content

Permission confirmation dialog #1

@jpierzchala

Description

@jpierzchala

Hi Kevin,

I am trying to use your sample here to implement Graph calls from within the bot I've met with limited success.

Thanks to your tips I have configured both AAD App and Azure Bot so that I can run following code:

  storage,
  ai: {
      planner,
      promptManager,
      prompt: 'chat',
      history: {
          assistantHistoryType: 'text'
      }
  },
  authentication: {
    connectionName: config.connectionName,
    text: "Please Sign In",
    title: "Sign In",
    timeout: 300000,
  }
});

...

app.message('/profile', async (context, state) => {
  const graphService = new GraphService(state.temp.value.authToken);
    let events = await graphService.getNextTwoWeeksCalendars();
    await context.sendActivity("/calendar finished");
  });

This works. The problem I have is with scopes. Whenever I add a scope to the OAuth Connection, when I run the bot it hangs.

What I need to do is to go to Azure Portal > Azure Bot > Configuration > Connection settings

There I need to press Test Connection after which a Permission requested dialog is opened and I need to accept.

Once this is done, I can use the added scope without problem.

Obviously, I need to somehow handle this within the bot but I am not sure how.

Could you tell me how did you solve this issue? Reviewing your index.ts and graphService.ts I cannot find the code you use to handle this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions