Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems encountered following tutorial on Windows #1

Open
robinmalik opened this issue Nov 23, 2017 · 1 comment
Open

Problems encountered following tutorial on Windows #1

robinmalik opened this issue Nov 23, 2017 · 1 comment

Comments

@robinmalik
Copy link

robinmalik commented Nov 23, 2017

Hi,

Thanks for your work on this tutorial. I thought a few additions to the readme.md might help others save a many hours of troubleshooting. These are the problems I encountered in order:

  1. Curl was failing out of the box. Modifying the code to the following:
if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
}
else {
    $response = json_decode($response, true);
    if (array_key_exists("access_token", $response)) {
        return $response["access_token"];
    } else {
        //echo "Failed to retrieve access token";
        exit();
    }
}

showed the error SSL certificate problem: unable to get local issuer certificate. I had to download cacert.pem to store locally, and update curl.cainfo in php.ini to point to this path.

  1. I kept getting invalid client credentials; after some googling, it appeared that if you have a + in the client secret key, it fails. Once I generated a key without that in, authentication worked, but then I hit another error: Application is not supported for this API version.

  2. apps.dev.microsoft.com offers the ability to create two types of apps: "Converged" and "Azure AD Only". Having successfully worked with the Graph API using PowerShell and an application created in portal.azure.com (which displays under 'Azure AD Only' on apps.dev.microsoft.com) I had assumed this would also work - it did not. It seems then, that the type of application required is of type 'Converged'.

  3. The apps.dev.microsoft.com portal did not appear to allow the specification of a reply URL during the creation process. I had to create the application first and then edit the application manifest file to put "http://localhost" into the replyUrls section.

@robinmalik
Copy link
Author

robinmalik commented Nov 24, 2017

My mistake on part 4. I had not added the platform of type 'web' the first time around; if you do that, you do indeed get the redirect URI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant