developer
108 TopicsAuthentication issue while using Client Credential through Oauth2.0
Hi Community Hope you are doing well. I am unable to authenticate to our registered app in azure. I am looking to test the get/users graph api using insomnia (similar tool as postman). During Token generation we are getting 401 error. we are provide correct Client ID and Secret with right scope url. I created the app, added the necessary permissions and the client credentials. Do I need to add a redirect uri to the app? Does the app need to be registered account types as "accounts in any organization directory"? I am getting a 401 unauthorized error Can you please assist what I'm what is missing here? I will really do appreciate your help. Thanks Vatan14Views0likes0CommentsFacing issue for Outlook calendar Sync with PHP
When using Microsoft Graph Explorer, and making request, it’s returning the events data correctly. But when in code we generate access token, it’s not able to make request and there is some permission issue, So, the access token we are generating through code as per the official Microsoft documentation, isn’t having the required permission, even though we are specifying the required permission array as scope when making request for access token. Below is the code, I am using public function authorize() { $auth_url = $this->Microsoft_calendar_model->createAuthUrl(); redirect($auth_url); } public function createAuthUrl() { $authorize_url = "{$this->auth_base_url}/{$this->tenant_id}/oauth2/v2.0/authorize"; $queryParams = http_build_query([ 'client_id' => $this->client_id, 'response_type' => 'code', 'redirect_uri' => $this->redirect_uri, 'scope' => implode(' ', $this->scopes), 'response_mode' => 'query', 'prompt' => 'consent' ]); return "{$authorize_url}?{$queryParams}"; } // User is getting prompt for permission consent and even though accepting all permissions isn't working public function callback() { $code = $this->input->get('code'); // I am getting the code here. $access_token = $this->microsoft_calendar_model->fetchAccessTokenWithAuthCode($code); } Issue occurs in the below function public function fetchAccessTokenWithAuthCode($code) { $token_url = "{$this->auth_base_url}/{$this->tenant_id}/oauth2/v2.0/token"; $client = new \GuzzleHttp\Client(); $response = $client->post($token_url, [ 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded' ], 'form_params' => [ 'client_id' => $this->client_id, 'client_secret' => $this->client_secret_value, 'redirect_uri' => $this->redirect_uri, 'code' => $code, 'grant_type' => 'authorization_code', 'scope' => 'offline_access Calendars.ReadWrite' ] ]); $tokenData = json_decode($response->getBody()->getContents(), true); $tokenContext = new AuthorizationCodeContext( $this->tenant_id, $this->client_id, $this->client_secret_value, $tokenData['access_token'], $this->redirect_uri ); $graphClient = new GraphServiceClient($tokenContext, $this->scopes); $events = $graphClient->me()->calendars()->byCalendarId('primary')->events()->get()->wait(); pre($events); } What I'm doing wrong, I can't figure it out anywhere?33Views0likes0CommentsProblem when sending out the invitation
I'm facing an issue where the invitation isn't being sent to the recipient, even though the API request runs successfully. I followed the tutorial in the link below, but the response I received is slightly different. https://learn.microsoft.com/en-us/graph/api/driveitem-invite?view=graph-rest-beta&tabs=http It has the Invitation in the return response My response result doesn't have the invitation. As result I did no receive any invitation email. Anyone can help me this?45Views0likes0CommentsPull out events from a calendar
Good morning, For a project I would have to pull out all the events from the different meeting rooms and integrate them into an HTML. However, when I search with https://graph.microsoft.com/v1.0/users/96d86e71-60d8-4d9a-acad-bd708de3e29a/events I get the error "The specified object was not found in the store." Could someone help me?20Views0likes1CommentTeams Missed Calls
Hi, I would like to know if there is a Graph API that gives me information if a peer to peer call between Teams users has not been successful. Or if a call has not been successful because the caller has abandoned the call, therefore it is a missed call. Regards. P.S. based on following documentation, I cannot find any information about what I'am searching for: List callRecords - Microsoft Graph v1.0 | Microsoft Learn8Views0likes0CommentsReorder Teams Channel tabs, move a 3rd tab to be the last tab?
I have an automate power automate flow which Create a Teams site, channels & tabs. now inside the General channel, we add the following custom tabs (Active DashBoard, Incident -12: Tasks and Template & training), as follow:- but i will get those 3 built-in tabs; Posts, Files and Notes.. now how i can move the Notes tab to be last tab ? using Graph API? Thanks59Views0likes0CommentsGraph API - GET /authentication/methods only return default method
Hi All, I need to list / manage MFA authentication method of users that invited from external AD (Home Tenant) through my resource tenant via Graph API. But GET API only return default authentication method (passwordAuthenticationMethod). I grantedUserAuthenticationMethod.Read.All API permission to my application. Is this because user account is from external AD (external to my resource tenant) or do I missing something here?163Views0likes2CommentsUsing microsoft graph to pull calendar data weekly
Hello- I've building an app that requests calendar access from users with Graph API. I am hoping to request permissions once and then pull calendar data weekly but I'm not sure if this is possible. I'm using the python ms-graph sdk and the interactive authentication client to request access. I am seeing some things about offline_access scope providing a refresh token but unsure how it works and the docs I found haven't been helpful. Any help would be appreciated!107Views0likes0CommentsHow to get the days for re-authenticate from Azure directory
Hello Community, I was trying to fetch the time for which a device authentication can be trusted. The problem is that there is no conditional policy set and the policies for token issuance, and lifetime return an empty array using Graph API (pretty sure, they are not set either). I see the number of days required to re-authenticate using a particular device here. Is there a way to extract this "30" days interval usingGraph API? Thank you.134Views0likes1Comment