General help

Oauth2 authentification - issue with Microsoft

Re: Oauth2 authentification - issue with Microsoft
Group Core developersGroup Moodle HQGroup Particularly helpful MoodlersGroup Plugin developersGroup Testers

Thanks for posting the screenshots and urls - they helped me diagnose this problem. 

By replacing the code parameter with "a" characters and testing different lengths I was able to determine there is a configuration problem in your Apache server that is preventing this from working. OAuth works by passing long unguessable tokens around, so it requires very long url parameters. 

You can see the problem is reflected by different error message responses from these 2 urls:

Not working                                                                                                                 



I googled this problem for you and this is the most likely answer:

Cheers, Damyon

Average of ratings: Useful (1)
Picture of Yvan Urunuela
Re: Oauth2 authentification - issue with Microsoft

Thanks a lot Damyon, it works!

For those who get the same problem, some information (I'm not an expert but it could help):

- As Damyon said, the problem is the lenght of the URL (number of characters). The Php Suhosin patch has a defaut limit of 512 characters for get parameters. In my case, the URL had more than 900...
- To fix the problem, you have to change the suhosin.get.max_value_length = <limit> in the php.ini, for example suhosin.get.max_value_length = 2000
- In my case, I was not able to change it by myself (I changed the php.ini in Cpanel but nothing happens), I had to ask the web hosting team to do it for me (check with your web hosting service).

Thanks Damyon and Adam for your precious help.

Average of ratings: Useful (1)