Coder Social home page Coder Social logo

outlook-php's People

Contributors

janpettermg avatar sagarrabadiya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

outlook-php's Issues

Login After i am not able to Build proper Token

i receive $_GET['code'] variable value form my Redirect URL
but after not execute try block it is direct it's catch block execute, so why am i not able to get proper success response.
here is issue file located: src/Outlook/Authorizer/Authenticator.php

    try {
            $response = $httpClient->post($this->authority.$this->tokenUrl, [
                'form_params' => $params
            ]);
            // we got token successfully save it to session
            $tokenResponse = $this->deserialize($response->getBody()->getContents());
            $token = $this->buildTokenInstance($tokenResponse);
            $this->sessionManager->set($token);
            return $token;
        } catch (\Exception $e) {
            throw new TokenException($e->getMessage(), $e->getCode(), $e);
        }

here is my Response:
outlookissue2

Does the login/authentication work as a service?

The authentication instructions in the README seem to be the ones corresponding to the login as a user, is that correct? Could you please give me a hint if any of your code can be extended/reused for the login as a service? I will implement it and open a PR if you want (and if I am not misunderstanding something).

Single tenant support?

Trying to log in to my organisation account, using an app ID registered using the same account, I'll get this error:

AADSTS50194: Application 'xxxxxxxxxx' is not configured as a multi-tenant application. Usage of the /common endpoint is not supported for such applications created after '10/15/2018'. Use a tenant-specific endpoint or configure the application to be multi-tenant.

Microsoft site states the following:

By default, web app/API registrations in Azure AD are single tenant. You can make your registration multi-tenant by finding the Multi-Tenanted switch on the Properties pane of your application registration in the Azure portal and setting it to Yes.

There is an Tenant restrictions page in Azure, but You don’t have access to this data. Please contact your global administrator to get access.

I also have an Directory (tenant) ID as well as an list of different endpoints available, witch all include the tenant in the URL, so where do I specify the tenant in this library?

I just want API access to access my own calendar, that's it...

Not getting renewed access token using refresh token.

use GuzzleHttp\Client;
private function getToken($grantType,$code){
try{
$parameterName = $grantType;
if (strcmp($parameterName, 'authorization_code') == 0) {
$parameterName = 'code';
}
$httpClient = new \GuzzleHttp\Client();
$params = [
"grant_type" => $grantType,
$parameterName => $code,
"redirect_uri" => REDIRECT_URI_OUTLOOK,
"scope" => implode(" ", ['openid', 'offline_access']),
"client_id" => APP_ID_OUTLOOK,
"client_secret" => APP_PASSWORD_OUTLOOK
];

        $response = $httpClient->post("https://login.microsoftonline.com/common/oauth2/v2.0/token",
                                    ['form_params' => $params]);
        $token = $response->getBody()->getContents();
        return $token;
    } catch (Exception $e) {
    } 
}

getToken('refresh_token',$refreshToken);

Call to a member function set() on null

Tried the example in the readme, but got this error...
Seems like some (unknown) class isn't constructed at time of a member function call.

Version 0.1.5
PHP 7.2.14

Fatal error:  Uncaught Error: Call to a member function set() on null in /vendor/sagar/outlook-php/src/Outlook/Authorizer/Authenticator.php:111
Stack trace:
#0 Outlook\Authorizer\Authenticator->getToken()
#1 {main}
thrown in /vendor/sagar/outlook-php/src/Outlook/Authorizer/Authenticator.php on line 111

The audience claim value is invalid 'aud'

Following the events example I get the following error:

Fatal error:
Uncaught Outlook\Exceptions\Events\RestApiException: The audience claim value is invalid 'aud'. in (...)/vendor/sagar/outlook-php/src/Outlook/Events/EventManager.php:52
Stack trace:
#0 (...)/ocal.php(36): Outlook\Events\EventManager->all()
#1 {main}
thrown in (...)/vendor/sagar/outlook-php/src/Outlook/Events/EventManager.php on line 52

No idea why, can't find the value aud anywhere either...
Any suggestions?

Unable to renew access token using refresh token

{
"error": "invalid_grant",
"error_description": "AADSTS70000: The user could not be authenticated as the grant is expired. The user must sign in again.\r\nTrace ID: 57a50e0a-2446-4543-8760-aff1583b2b00\r\nCorrelation ID: 80554d13-fead-4e28-a311-cf106e42dd92\r\nTimestamp: 2019-05-24 10:32:25Z",
"error_codes": [
70000
],
"timestamp": "2019-05-24 10:32:25Z",
"trace_id": "57a50e0a-2446-4543-8760-aff1583b2b00",
"correlation_id": "80554d13-fead-4e28-a311-cf106e42dd92"
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.