Error Occurred when following the example provided: "/me request is only valid with delegated authentication flow."

Created on 13 September 2021, about 3 years ago
Updated 8 January 2024, 11 months ago

Problem/Motivation

I would like to use the MS Graph Api to retrieve information about a particular user. After configuring the keys I am able to retrieve lists (from /Users) which would indicate the Graph API is working. However, when I try to retrieve a user about myself (following the example on the readme) it responds with an error: "/me request is only valid with delegated authentication flow.". I do understand that some preprocessing needs to occur (such as logging in), but not sure where this piece of the code or module is for me to test it out.

Steps to reproduce

install microsoft_graph_api using: composer require 'drupal/ms_graph_api'
create a new module with a form containing the sample code from the readme
install the module
error occurred on website, so retrieve the error from the logs

πŸ› Bug report
Status

Active

Version

1.0

Component

Documentation

Created by

πŸ‡¨πŸ‡¦Canada lawrenceong

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡―πŸ‡΄Jordan ahmadhalah

    Hello GuyPaddock,

    I have followed all the steps in your comment but still I'm facing the same issue

    I'm not familiar with MS Azure but after my research I believe there is a missing step for OAuth authentication to get the access token to initiate the request

  • Status changed to Active 11 months ago
  • πŸ‡ΊπŸ‡ΈUnited States GuyPaddock

    @ahmadhalah: "Needs review" is the status for if you have proposed code changes. I still believe your issue lies outside this module and that it would be better for you to work with the Azure API team instead, but I will keep this open for now.

Production build 0.71.5 2024