As of September 15, 2019, Linkedin API will no longer be supporting GET requests to retrieve OAuth access tokens. OAuth access tokens should be retrieved by making a POST request to https://www.linkedin.com/oauth/v2/accessToken.
I've not tested it yet, but I believe that changing this line to use POST could be sufficient.