microsoftgraph / microsoftgraph/msgraph-sdk-php

Using package in laravel

Open
#1,683 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
669
Forks
150
Avg merge
15h 21m
Merged PRs (30d)
3

Description

Please help me, i'm confused
I have project using laravel and laravel socialite, i got access_token from laravel socialite. How to use that access_token in this package?

I use this method

$tokenRequestContext = new OnBehalfOfContext(
  config("services.microsoft.tenant"),
  config("services.microsoft.client_id"),
  config("services.microsoft.client_secret"),
  session()->get("microsoft_access_token"),
);

$graphServiceClient = new GraphServiceClient($tokenRequestContext);
$user = $graphServiceClient->me()->get()->wait();
dd($user);

why the process is very long, and the result is invalid grant? I have checked that all parameters (tenant id, client id, etc) are valid

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the shown OnBehalfOfContext construction and GraphServiceClient->me()->get() call, then verify whether the Laravel Socialite token is the token type this flow expects. Done means documenting or demonstrating the supported access-token flow and resolving the invalid-grant behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, php
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.