dcblogdev / laravel-microsoft-graph Goto Github PK
View Code? Open in Web Editor NEWLaravel package for Microsoft Graph API (Microsoft365)
Home Page: https://dcblog.dev/docs/laravel-microsoft-graph
License: Other
Laravel package for Microsoft Graph API (Microsoft365)
Home Page: https://dcblog.dev/docs/laravel-microsoft-graph
License: Other
On version 6.x of Laravel, I get the following error when running
composer require daveismyname/laravel-msgraph
` Problem 1
- Installation request for daveismyname/laravel-msgraph ^2.03 -> satisfiable by daveismyname/laravel-msgraph[v2.03].
- Conclusion: remove laravel/framework v6.5.2
- Conclusion: don't install laravel/framework v6.5.2
- daveismyname/laravel-msgraph v2.03 requires illuminate/support ~5 -> satisfiable by laravel/framework[5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.x-dev, 5.8.x-dev], illuminate/support[5.0.x-dev, 5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5.7.19, 5.7.x-dev, 5.8.x-dev, v5.0.0, v5.0.22, v5.0.25, v5.0.26, v5.0.28, v5.0.33, v5.0.4, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.4, v5.8.8, v5.8.9].
- Can only install one of: laravel/framework[5.5.x-dev, v6.5.2].
- Can only install one of: laravel/framework[5.6.x-dev, v6.5.2].
- Can only install one of: laravel/framework[5.7.x-dev, v6.5.2].
- Can only install one of: laravel/framework[5.8.x-dev, v6.5.2].
- Can only install one of: laravel/framework[5.4.x-dev, v6.5.2].
- don't install illuminate/support 5.5.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.16|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.17|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.2|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.33|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.34|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.35|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.36|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.37|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.39|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.40|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.41|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.43|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.5.44|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.6.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.1|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.10|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.11|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.12|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.13|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.14|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.15|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.16|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.17|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.19|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.2|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.20|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.21|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.22|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.23|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.24|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.25|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.26|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.27|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.29|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.3|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.30|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.31|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.32|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.33|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.34|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.35|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.36|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.37|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.38|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.39|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.4|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.5|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.6|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.7|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.8|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.6.9|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.7.17|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.7.18|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.7.19|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.7.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.1|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.10|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.11|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.15|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.2|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.20|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.21|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.22|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.23|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.26|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.27|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.3|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.4|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.5|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.6|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.7|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.8|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.7.9|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.8.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.11|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.12|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.14|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.15|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.17|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.18|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.19|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.2|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.20|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.22|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.24|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.27|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.29|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.3|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.30|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.31|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.32|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.33|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.34|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.35|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.4|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.8|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.8.9|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.1.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.2.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.3.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.4.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.1|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.13|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.16|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.2|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.20|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.22|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.25|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.30|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.31|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.41|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.6|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.1.8|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.19|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.21|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.24|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.25|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.26|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.27|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.31|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.32|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.37|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.43|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.45|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.6|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.2.7|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.3.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.3.16|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.3.23|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.3.4|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.13|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.17|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.19|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.27|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.36|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.4.9|don't install laravel/framework v6.5.2
- don't install illuminate/support 5.0.x-dev|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.0|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.22|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.25|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.26|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.28|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.33|don't install laravel/framework v6.5.2
- don't install illuminate/support v5.0.4|don't install laravel/framework v6.5.2
- Installation request for laravel/framework (locked at v6.5.2, required as ^6.2) -> satisfiable by laravel/framework[v6.5.2].
Installation failed, reverting ./composer.json to its original content.
`
Dear @dcblogdev ,
I hope this message finds you well. I recently came across an issue while using your repository and wanted to bring it to your attention.
The error I encountered was: " error 90: Undefined property: stdClass::$access_token] ". This happens when this function is executed
public function connect()
{
return MsGraphAdmin::connect();
}
I've set up everything as instructed by your documentation. I'm not sure whether the error is happening on the repository side or in my Azure Active Directory App Registration.
I would greatly appreciate it if you could look into this issue and let me know if there is a solution or workaround. I have done research on this error but so far, I have been unable to resolve it.
Thank you for your time and for maintaining this repository. I am a big fan of your work and I appreciate all the effort you have put into it.
Best regards,
Kristian Marku.
Hi, I'm trying to get my personal emails by your pkg, this is my code:
in .env
:
MSGRAPH_CLIENT_ID=01306e60-4f2d-425cxxxxxxxxxx // Application (client) ID from 'aad.portal.azure.com'
MSGRAPH_SECRET_ID=f3cb7221-4a86-468cxxxxxxxxxxx // Object ID from 'aad.portal.azure.com'
MSGRAPH_TENANT_ID=9597912b-442e-4ce3xxxxxxxxxx // Directory (tenant) ID from 'aad.portal.azure.com'
Route::get('/', function () {
$emails = MsGraph::getEmails();
dd($emails);
});
I got error
Object of class Illuminate\Routing\Redirector could not be converted to string
Hi, would just say that this package is awsome...
Just wondering if this is a issue or a permanently change.
In the bottom om the documentation on MsGraph, says that only the endpoint should be added and the package provides the base with beta version selected, but in the source code the v1.0 is provided.
MsGraph.php
protected static $baseUrl = 'https://graph.microsoft.com/v1.0/';
Error im getting with versions higher than 3.2.4 is:
Dcblogdev\MsGraph\MsGraphAdmin::guzzle(): Argument #3 ($data) must be of type array, null given
Problem 1
- Installation request for guzzlehttp/guzzle ^7.2 -> satisfiable by guzzlehttp/guzzle[7.2.0].
- dcblogdev/laravel-microsoft-graph v3.02 requires guzzlehttp/guzzle ^6 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- dcblogdev/laravel-microsoft-graph v3.02 requires guzzlehttp/guzzle ^6 -> satisfiable by guzzlehttp/guzzle[6.5.x-dev].
- Conclusion: don't install guzzlehttp/guzzle 6.5.x-dev
- Installation request for dcblogdev/laravel-microsoft-graph ^3.02 -> satisfiable by dcblogdev/laravel-microsoft-graph[v3.02].
Hi, im Currently using version 3.2.0 + Laravel 6
and It throws the following error when trying to resolve the login path for miscrosoft:
Symfony\Component\Debug\Exception\FatalThrowableError Class 'Illuminate\Support\Facades\Http' not found
At MsGraph.php Line 78 :
$response = Http::withToken($accessToken->getToken())->get(self::$baseUrl.'me');
Does it seem to be related to abruptly removing support for versions lower than 10? Is there a possibility of persisting support for versions from 6+ for new package updates?
Because it is not consistent that a minor version works in a major update of the framework but its previous version does not.
(for example version v3.1.9 works correctly in Laravel 6)
If we think about the future, I suggest not removing support for old LTS versions of the framework from a minor version of the package, since here they make a 'composer update' that continues using version 3.x.x of the package, it would burst the application. I mention this because the user should not be forced to update the framework completely because the package is not compatible. Well now the alternatives would be to refactor the functionality or change the package completely.
I appreciate your help!
Hi
I am trying to extend the functionality of this great package in order to able to use more resources e.g to be able to call MsGraph::get('me/sites').
In MsGraph.php in getProviders function there is a reference in urlResourceOwnerDetails inside config file but is not visible.
Could you pls help.
Is there any possibility to include sites in your resources as well?
Thanks
I have issue this month when i want to upload my file (ZIP) to Onedrive. On Laravel Log it's showing
Cannot use object of type stdClass as array {"userId":16,"exception":"[object] (Error(code: 0): Cannot use object of type stdClass as array at /home/.../public_html/.../vendor/dcblogdev/laravel-microsoft-graph/src/Resources/Files.php:72)
how to fix it?
Hello David,
I use your package on a project.
I'm not sure the problem I noticed is due to your library, but maybe you can confirm/infirm and it could help...
I observe a problem only with Laravel but not with my API client.
Indeed , this query works perfectly with Insomnia or Postman :
https://graph.microsoft.com/v1.0/users?$filter=accountEnabled eq true and startswith(userPrincipalName, 'm') and startswith(officeLocation,'ens') &$count=true&$top=999
When I try to use this in Laravel
$ens = Http::withToken($token)
->get('https://graph.microsoft.com/v1.0/users?$filter=accountEnabled eq true
and startswith(userPrincipalName, \'m\')
and startswith(officeLocation, \'ens\')
&$count=true&$top=999');
It doesn't work and give this error :
Unsupported or invalid query filter clause specified for property 'officeLocation' of resource 'User'."
However this query works perfectly:
$ens = Http::withToken($token)
->get('https://graph.microsoft.com/v1.0/users?$filter=accountEnabled eq true
and startswith(userPrincipalName, \'m\')
&$count=true&$top=999');
The credentials/token I use in Insomnia and my Laravel project are obviously the same ones.
Do you have any idea about the reason which generates this problem please ?
Sorry if I am in the wrong place to ask this question.
Thank you,
Reka
In some cases, the mail value in the token is returning null. I modified the listener in my app to look at userPrincipalName and update the token in the database appropraitely. However, it looks like the MsGraph code is overwriting this:
//find record and add email - not required but useful none the less
$t = MsGraphToken::findOrFail($result->id);
$t->email = $me['mail'];
$t->save();
I'm using the following check in the listener. Can this be added into the MsGraph code so that $t->email is set correctly?
if ($event->token['info']['mail']===null) {
$email=$event->token['info']['userPrincipalName'];
} else {
$email=$event->token['info']['mail'];
}
Hi,
First of all, thanks fr this package, it's very usefull :)
When a user log in for the first time, a row is inserted in the users table, but if this user log out then try to log in again, there is an "duplicate entry" error.
Hi, I had service to upload/download files to oneDrive, everything worked fine, but this week i noticed (i dont really know when it started), but msgraph:keep-alive
command throws error:
League\OAuth2\Client\Provider\Exception\IdentityProviderException
invalid_grant
at /home/service/fservice/vendor/league/oauth2-client/src/Provider/GenericProvider.php:222
218▕ $code = $this->responseCode && !empty($data[$this->responseCode])? $data[$this->responseCode] : 0;
219▕ if (!is_int($code)) {
220▕ $code = intval($code);
221▕ }
➜ 222▕ throw new IdentityProviderException($error, $code, $data);
223▕ }
224▕ }
225▕
226▕ /**
�[2m+18 vendor frames �[22m
19 /home/service/fservice/artisan:37
Illuminate\Foundation\Console\Kernel::handle()
maybe someone have idea why this happend? Nothing changed, tokens valid.
I attempted to integrate it in Laravel 9 following the instructions, but clearly the package has multiple errors for L9.
If this repository isn't abandoned, I would appreciate an update to support L9.
Hi,
The published migrations fail (in laravel 9 anyway) with Cannot declare class create_ms_graph_tokens_table, because the name is already in use
I had to change the class name to CreateMsGraphTokensTable to get the migration to run.
Cheers!
I've followed the instruction twice now, and unable to resolve this issue.
It goes to MS to confirm login/password/MFA then returns to
https://ccpoc.dd/msgraph/oauth?code=0.AQkArh-U4PDsz0u3wnZaCKL4Ky3.........
and rendering a 404 error?
Very simple single tenant...
Any help would be appreciated.
After a successful login, upon returning to the redirect URI, I get:
{
"error":{
"code":"InvalidAuthenticationToken",
"message":"CompactToken parsing failed with error code: 80049217",
"innerError":{
"date":"2022-10-10T10:54:32",
"request-id":"18925d88-bfc6-4d27-b579-7648264e1221",
"client-request-id":"18925d88-bfc6-4d27-b579-7648264e1221"
}
}
I don't even know where to start with debugging, to be honest.
Hello,
I just ran into an issue while implementing the library.
The token retrieved from the DB in the listener is not the good one. It seems like it is always the first one because of the line 14 :
$token = MsGraphToken::find($tokenId)->first();
The call to "first()" on "find()" result leads to erroneous behaviour because every user will be authenticated as the first one.
I suggest fixing it like this (adding a check on existence as well, with findOrFail()) :
$token = MsGraphToken::findOrFail($tokenId);
I want to move emails (by ID) from the inbox to a another foler in the same mailbox.
Does anyone have any pointers for this?
Much appreciated.
Hello, I keep getting this error whenever I try to run:
$emails = MsGraph::emails()->get([ "\$orderby" => "displayName", "\$top" => 100, "\$skip" => 0, "\$count" => "true", ]);
The error page:
https://flareapp.io/share/w5BjNlD5#F51
It also happens when running for Contacts, Calendar etc...
I'm using Laravel 9.17.0 - PHP 8.1.6 running on localhost using Valet for Windows.
Permissions are all good, authentication is working well too.
Hello, when i try to log in with microsoft everything works fine and i get redirected to my MSGRAPH_LANDING_URL= but the account is not being added to the database.
Would you be interested in adding support for the delta call within the Graph API?
https://learn.microsoft.com/en-us/graph/api/message-delta?view=graph-rest-1.0&tabs=http
Hi all!
It's possible set the mime-type of the attachment??? I'm trying send a ical as attachment but everytime returns a error related with the mime-type
Realy good pacakge, but in first minutes I came to a problem, returning errors on contacts email etc.
Digging emails()->get() I see this:
$folder = $folderId == null ? 'Inbox' : $folderId;
//get inbox from folders list
$folder = MsGraph::get("me/mailFolders?\$filter=startswith(displayName,'$folder')");
But my "Inbox" folder is in other language rather than english, and it returns error. So if we take a look to microsoft docs ->
GET /me/mailFolders/inbox
$folder = MsGraph::get("me/mailFolders/$folder");
Like so, everything works fine.
Maybe in future should think about it.
When trying to create a Teams meeting, it works, but the returned JSON is a string so the following error is generated...
Dcblogdev\MsGraph\MsGraphAdmin::isJson(): Argument #1 ($data) must be of type object, string given, called in C:\xampp\htdocs\magna\vendor\dcblogdev\laravel-microsoft-graph\src\MsGraphAdmin.php on line 189
Code in use...
$graphresponse = MsGraphAdmin::post("/users/". config('msgraph.MeetingUserId') ."/onlineMeetings", [
'subject' => $booking->subject,
'startDateTime' => $booking->start_time,
'endDateTime' => $booking->end_time,
]);
Is there a reason for line 165 being specified as an object?
If I take out "object" it all works fine...
protected function isJson(/*object*/ $data): bool
Whenever I try to create a new contact with businessPhones or mobilePhone this error message is returned.
{"error":{"code":"UnableToDeserializePostBody","message":"were unable to deserialize "}}
$data = [
'displayName' => $crm_cascontact->surname.' '.$crm_cascontact->givenName,
'givenName' => $crm_cascontact->givenName,
'surname' => $crm_cascontact->surname,
'mobilePhone' => $crm_cascontact->mobilePhone
];
It appears that the store function works only with these parameters:
$data = [
'displayName' => 'John Smith',
'givenName' => 'John Smith',
'emailAddresses' => [
[
'address' => '[email protected]',
'name' => 'John Smith'
]
]
];
Would you be open to integrating the Calendar part of the Microsoft Graph API into your package? If needed, i'm willing to contribute and submit pull requests to help implement this feature.
Please let me know your thoughts. Thank you.
Specifically: https://learn.microsoft.com/en-us/graph/api/calendar-list-events?view=graph-rest-1.0&tabs=http
So I'm planning to change the API for a v2 that will break the traits but will offer a more uniformed API such as:
MsGraph->contacts()->get()
MsGraph->contacts()->find()
MsGraph->contacts()->create()
MsGraph->contacts()->update()
MsGraph->contacts()->delete()
MsGraph->emails()->get()
MsGraph->emails()->find()
MsGraph->emails()->send()
MsGraph->emails()->reply()
MsGraph->emails()->forward()
MsGraph->emails()->delete()
MsGraph->calendar()->get()
MsGraph->calendar()->find()
MsGraph->calendar()->send()
MsGraph->calendar()->reply()
MsGraph->calendar()->forward()
MsGraph->calendar()->delete()
I am trying to use this endpoint to be able to add a student to a class, but I get an error, I have tried modifying the lines in almost every way, I have tried to understand the API but it is still somewhat complicated for me, I have looked for the error it sends in many places, without any success.
$Estudiante = [
"@odata.id" => "https://graph.microsoft.com/beta/education/users/{student_id}"
];
$Resultado = MsGraphAdmin::post('education/classes/{classes_id}/members/$ref', $Estudiante);
dd($Resultado);
here the error
{#1252 ▼
+"error": {#1230 ▼
+"code": "AccessDenied"
+"message": "Required claim values are not provided."
+"innerError": {#1261 ▼
+"request-id": "a7c74dd9-7fb4-4c6b-b3c9-6c6398916001"
+"date": "2020-06-03T14:42:39"
}
}
}
I turn to you since I am using your library which helps me a lot with the other APIs that I am using from Microsoft.
Can someone assist with some code to work a SharedMailbox? (List, Read, Move, Delete etc)
I can't seem to find this in the Graph sandbox either?
Any help would be appreciated.
Thank you
Having followed the installation and graph application setup a few times now, I am constantly getting the error error:invalid_client after being redirected back to the /connect endpoint post sign-in. I have checked al of the details several times and have created a few different secrets but always recieve the same error, does this package still work with the current graph API?
I'm trying to send mails as admin with the following code.
MsGraphAdmin::emails()
->userid()//userPrincipalName
->to()
->subject()
->body()
->send();
I get the following error:
Cache-Control: no-cache, private
Date: Mon, 17 Oct 2022 19:18:13 GMT
Location: https://xx/connect
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="refresh" content="0;url='https://xx/connect'" />
<title>Redirecting to https://xx/connect</title>
</head>
<body>
Redirecting to <a href="https://xx/connect">https://spnl.eu/connect</a>.
</body>
</html>" is not valid header value in C:\laragon\www\vendor\guzzlehttp\psr7\src\MessageTrait.php:261
In the guzzle method it tries to add the access token by $this->getAccessToken(), however this returns a redirection to the connect page.
Also not sure how the 'id' is passed trough in MsGraphAdmin.php
* Return authenticated access token or request new token when expired.
*** @param $id integer - id of the user**
* @param $returnNullNoAccessToken null when set to true return null
* @return return string access token
*/
public function getAccessToken($returnNullNoAccessToken = null)
{
//use id if passed otherwise use logged-in user
$token = MsGraphToken::where('user_id', null)->first();
Could you please help me w/ this or provide some documentation since I can't find any.
I've tried using the msgraph:keep-alive command but it does nothing so my token always expires and I need to reconnect manually every time.
Thanks in advance.
Hello,
I wanted to use this package to be able to acces our team drive to downloads files with a command runned as background cron.
For this i need to be able to get the token without human action each time but when i connect the first time my refresh_token field is empty is my base, is this normal ?
Hello,
I`m currently checking and planning to use your library but it looks like MsGraphAdmin::files() and Dcblogdev\MsGraph\AdminResources\Files are not properly working. MsGraphAdmin is missing the Files import and in Dcblogdev\MsGraph\AdminResources\Files you are using MsGraph not MsGraphAdmin.
I hope you can also implement creating folders, setting folders permissions, and upload files.
Thanks
Hi,
I'm trying to get the photo using:
MsGraph::get('me/photo/$value');
But the response is NULL, I've checked the other online documents, such request need to have a different responseType.
Any ideas?
Every time a new user logs in, it replaced the last users token entry on the database.
Hi, I tried to integrate login using ms graph. And I already follow steps from https://docs.dcblog.dev/laravel-microsoft-graph/msgraph/login-with-msgraph
But the listener seems not fired because when I check database, there's no new user record.
Hello,
I want to login with MS Graph
https://dcblog.dev/docs/laravel-microsoft-graph/msgraph/login-with-msgraph
Laravel 9.23.0
But /login
returns
Illuminate\Contracts\Container\BindingResolutionException
Target class [App\Http\Controllers\AuthController] does not exist.
Someone knows why, I have not found errors on the code ?
Thanks,
//app\Http\Controllers\AuthController.php
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Dcblogdev\MsGraph\Facades\MsGraph;
class AuthController extends Controller
{
public function login() {return view('auth.login');}
public function connect() {return MsGraph::connect();}
public function logout() {return MsGraph::disconnect('/');
}
}
//routes\web.php
<?php
use Illuminate\Support\Facades\Route;
Route::redirect('/', 'login');
Route::group(['middleware' => ['web', 'guest'], 'namespace' => 'App\Http\Controllers'], function(){
Route::get('login', 'AuthController@login')->name('login');
Route::get('connect', 'AuthController@connect')->name('connect');
});
Route::group(['middleware' => ['web', 'MsGraphAuthenticated'], 'prefix' => 'app', 'namespace' => 'App\Http\Controllers'], function(){
Route::get('/', 'PagesController@app')->name('app');
Route::get('logout', 'Auth\AuthController@logout')->name('logout');
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.